aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes
diff options
context:
space:
mode:
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>2025-03-13 12:04:09 +0000
committerGerrit Code Review <gerrit@wikimedia.org>2025-03-13 12:04:09 +0000
commit45dd4c4769c08d66253d0eadf76759f093d5fd1c (patch)
tree00da352a4b4f6934f99b7771cb06eb215882add8 /tests/phpunit/includes
parent672298f8ede3aa41bbd7e211ca9e0f6f1bf91085 (diff)
parent6681302aab823778614d74edf4c0f1a38161590b (diff)
downloadmediawikicore-45dd4c4769c08d66253d0eadf76759f093d5fd1c.tar.gz
mediawikicore-45dd4c4769c08d66253d0eadf76759f093d5fd1c.zip
Merge "fix(ApiParamValidator): PARAM_HELP_MSG_PER_VALUE for multi-string types"
Diffstat (limited to 'tests/phpunit/includes')
-rw-r--r--tests/phpunit/includes/api/Validator/ApiParamValidatorTest.php35
1 files changed, 34 insertions, 1 deletions
diff --git a/tests/phpunit/includes/api/Validator/ApiParamValidatorTest.php b/tests/phpunit/includes/api/Validator/ApiParamValidatorTest.php
index c6249a1cbfe9..cb53cec7d516 100644
--- a/tests/phpunit/includes/api/Validator/ApiParamValidatorTest.php
+++ b/tests/phpunit/includes/api/Validator/ApiParamValidatorTest.php
@@ -360,7 +360,40 @@ class ApiParamValidatorTest extends ApiTestCase {
'issues' => [
'X',
ApiBase::PARAM_HELP_MSG_PER_VALUE
- => 'PARAM_HELP_MSG_PER_VALUE can only be used with PARAM_TYPE as an array',
+ => 'PARAM_HELP_MSG_PER_VALUE can only be used with PARAM_TYPE as an array, or PARAM_TYPE = string and PARAM_ISMULTI = true',
+ ],
+ 'allowedKeys' => $keys,
+ 'messages' => [
+ MessageValue::new( 'apihelp-query+allpages-param-test' ),
+ ],
+ ]
+ ],
+ 'valid PARAM_HELP_MSG_PER_VALUE for array type' => [
+ [ 'test' => [
+ ParamValidator::PARAM_TYPE => [],
+ ApiBase::PARAM_HELP_MSG_PER_VALUE => [],
+ ] ],
+ 'test',
+ [
+ 'issues' => [
+ 'X',
+ ],
+ 'allowedKeys' => $keys,
+ 'messages' => [
+ MessageValue::new( 'apihelp-query+allpages-param-test' ),
+ ],
+ ]
+ ],
+ 'valid PARAM_HELP_MSG_PER_VALUE for multi string type' => [
+ [ 'test' => [
+ ParamValidator::PARAM_TYPE => 'string',
+ ApiBase::PARAM_HELP_MSG_PER_VALUE => [],
+ ParamValidator::PARAM_ISMULTI => true,
+ ] ],
+ 'test',
+ [
+ 'issues' => [
+ 'X',
],
'allowedKeys' => $keys,
'messages' => [