Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/369916 )

Change subject: Add apihelp messages to pass unit tests
......................................................................

Add apihelp messages to pass unit tests

Bug: T155020
Change-Id: I75e4624f151d3435484ad6e36edeb41ea0b83668
---
M api/ApiContestQuery.php
M api/ApiDeleteContest.php
M api/ApiMailContestants.php
M api/ApiQueryChallenges.php
M api/ApiQueryContestComments.php
M api/ApiQueryContestants.php
M api/ApiQueryContests.php
M i18n/en.json
M i18n/qqq.json
M includes/ContestDBObject.php
10 files changed, 48 insertions(+), 83 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Contest 
refs/changes/16/369916/1

diff --git a/api/ApiContestQuery.php b/api/ApiContestQuery.php
index 9889d02..f68fd4b 100644
--- a/api/ApiContestQuery.php
+++ b/api/ApiContestQuery.php
@@ -194,7 +194,8 @@
                        'props' => array(
                                ApiBase::PARAM_TYPE => array_merge( 
$this->getClass()->getFieldNames(), array( '*' ) ),
                                ApiBase::PARAM_ISMULTI => true,
-                               ApiBase::PARAM_DFLT => '*'
+                               ApiBase::PARAM_DFLT => '*',
+                               ApiBase::PARAM_HELP_MSG => 
'apihelp-query+contestbase-param-props',
                        ),
                        'limit' => array(
                                ApiBase::PARAM_DFLT => 20,
@@ -202,24 +203,13 @@
                                ApiBase::PARAM_MIN => 1,
                                ApiBase::PARAM_MAX => ApiBase::LIMIT_BIG1,
                                ApiBase::PARAM_MAX2 => ApiBase::LIMIT_BIG2
+                               ApiBase::PARAM_HELP_MSG => 
'apihelp-query+contestbase-param-limit',
                        ),
-                       'continue' => null,
+                       'continue' => array(
+                               ApiBase::PARAM_HELP_MSG => 
'apihelp-query+contestbase-param-continue',
+                       ),
                );
 
                return array_merge( $this->getClass()->getAPIParams(), $params 
);
-       }
-
-       /**
-        * (non-PHPdoc)
-        * @see includes/api/ApiBase#getParamDescription()
-        */
-       public function getParamDescription() {
-               $descs = array (
-                       'props' => 'Fields to query',
-                       'continue' => 'Offset number from where to continue the 
query',
-                       'limit' => 'Max amount of rows to return',
-               );
-
-               return array_merge( $this->getClass()->getFieldDescriptions(), 
$descs );
        }
 }
diff --git a/api/ApiDeleteContest.php b/api/ApiDeleteContest.php
index 95f8ef8..092ee79 100644
--- a/api/ApiDeleteContest.php
+++ b/api/ApiDeleteContest.php
@@ -72,19 +72,6 @@
                );
        }
 
-       public function getParamDescription() {
-               return array(
-                       'ids' => 'The IDs of the contests to delete',
-                       'token' => 'Edit token, salted with the contest id',
-               );
-       }
-
-       public function getDescription() {
-               return array(
-                       'API module for deleting contests.'
-               );
-       }
-
        protected function getExamples() {
                return array(
                        'api.php?action=deletecontest&ids=42',
diff --git a/api/ApiMailContestants.php b/api/ApiMailContestants.php
index 93a9a4e..d9d4a40 100644
--- a/api/ApiMailContestants.php
+++ b/api/ApiMailContestants.php
@@ -154,25 +154,6 @@
                );
        }
 
-       public function getParamDescription() {
-               return array(
-//                     'page' => 'Name of the page from which to pull content 
for the email body',
-                       'ids' => 'The IDs of the contestants to mail',
-                       'contestids' => 'The IDs of the contests where of the 
contestants should be mailed',
-                       'contestnames' => 'The names of the contests where of 
the contestants should be mailed',
-                       'challengeids' => 'The IDs of the challenges where of 
the contestants should be mailed',
-                       'challengetitles' => 'The titles of the challenges 
where of the contestants should be mailed',
-                       'token' => 'Edit token',
-               );
-       }
-
-       public function getDescription() {
-               return array(
-                       'API module for mailing contestants. Selection criteria 
will be joined with AND,
-                       except for the challange ids/titles and contest 
ids/names pairs, which will be joined with OR.'
-               );
-       }
-
        protected function getExamples() {
                return array(
                        'api.php?action=mailcontestants&ids=42',
diff --git a/api/ApiQueryChallenges.php b/api/ApiQueryChallenges.php
index d016a65..525160b 100644
--- a/api/ApiQueryChallenges.php
+++ b/api/ApiQueryChallenges.php
@@ -47,14 +47,6 @@
 
        /**
         * (non-PHPdoc)
-        * @see includes/api/ApiBase#getDescription()
-        */
-       public function getDescription() {
-               return 'API module for querying contest challenges';
-       }
-
-       /**
-        * (non-PHPdoc)
         * @see includes/api/ApiBase#getExamples()
         */
        protected function getExamples() {
diff --git a/api/ApiQueryContestComments.php b/api/ApiQueryContestComments.php
index 52f6760..4a95859 100644
--- a/api/ApiQueryContestComments.php
+++ b/api/ApiQueryContestComments.php
@@ -47,14 +47,6 @@
 
        /**
         * (non-PHPdoc)
-        * @see includes/api/ApiBase#getDescription()
-        */
-       public function getDescription() {
-               return 'API module for querying contest comments';
-       }
-
-       /**
-        * (non-PHPdoc)
         * @see includes/api/ApiBase#getExamples()
         */
        protected function getExamples() {
diff --git a/api/ApiQueryContestants.php b/api/ApiQueryContestants.php
index d632faa..5a607e3 100644
--- a/api/ApiQueryContestants.php
+++ b/api/ApiQueryContestants.php
@@ -47,14 +47,6 @@
 
        /**
         * (non-PHPdoc)
-        * @see includes/api/ApiBase#getDescription()
-        */
-       public function getDescription() {
-               return 'API module for querying contestants';
-       }
-
-       /**
-        * (non-PHPdoc)
         * @see includes/api/ApiBase#getExamples()
         */
        protected function getExamples() {
diff --git a/api/ApiQueryContests.php b/api/ApiQueryContests.php
index 10136b4..eb5e35d 100644
--- a/api/ApiQueryContests.php
+++ b/api/ApiQueryContests.php
@@ -47,14 +47,6 @@
 
        /**
         * (non-PHPdoc)
-        * @see includes/api/ApiBase#getDescription()
-        */
-       public function getDescription() {
-               return 'API module for querying contests';
-       }
-
-       /**
-        * (non-PHPdoc)
         * @see includes/api/ApiBase#getExamples()
         */
        protected function getExamples() {
diff --git a/i18n/en.json b/i18n/en.json
index 52458d6..506fc0f 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -195,5 +195,24 @@
        "contest-submission-current-submission": "This is the URL to your 
submission, which you can modify until the deadline.",
        "contest-submission-challenge": "You are currently participating in the 
$1 challenge.",
        "contest-submission-challenge-description": "'''Current challenge: 
$1''' -- $2",
-       "contest-submission-domains": "Submissions are restricted to 
{{PLURAL:$2|this site|these sites}}: $1"
+       "contest-submission-domains": "Submissions are restricted to 
{{PLURAL:$2|this site|these sites}}: $1",
+       "apihelp-deletecontest-summary": "API module for deleting contests.",
+       "apihelp-deletecontest-param-ids": "The IDs of the contests to delete.",
+       "apihelp-deletecontest-param-token": "Edit token, salted with the 
contest id.",
+       "apihelp-mailcontestants-summary": "API module for mailing 
contestants.",
+       "apihelp-mailcontestants-extended-description": "Selection criteria 
will be joined with AND, except for the challange ids/titles and contest 
ids/names pairs, which will be joined with OR.",
+       "apihelp-mailcontestants-param-page": "Name of the page from which to 
pull content for the email body.",
+       "apihelp-mailcontestants-param-ids": "The IDs of the contestants to 
mail.",
+       "apihelp-mailcontestants-param-contestids": "The IDs of the contests 
where of the contestants should be mailed.",
+       "apihelp-mailcontestants-param-contestnames": "The names of the 
contests where of the contestants should be mailed.",
+       "apihelp-mailcontestants-param-challengeids": "The IDs of the 
challenges where of the contestants should be mailed.",
+       "apihelp-mailcontestants-param-challengetitles": "The titles of the 
challenges where of the contestants should be mailed.",
+       "apihelp-mailcontestants-param-token": "Edit token.",
+       "apihelp-query+challenges-summary": "API module for querying contest 
challenges.",
+       "apihelp-query+contestants-summary": "API module for querying 
contestants.",
+       "apihelp-query+contestcomments-summary": "API module for querying 
contest comments.",
+       "apihelp-query+contests-summary": "API module for querying contests.",
+       "apihelp-query+contestbase-param-props": "Fields to query.",
+       "apihelp-query+contestbase-param-continue": "Offset number from where 
to continue the query.",
+       "apihelp-query+contestbase-param-limit": "Max amount of rows to return."
 }
\ No newline at end of file
diff --git a/i18n/qqq.json b/i18n/qqq.json
index b0e0d2d..f6b6d48 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -154,5 +154,24 @@
        "contest-submission-submit": "{{Identical|Submit}}",
        "contest-submission-challenge": "Tells the user which challenge they 
are part of. $1 is the challenge name",
        "contest-submission-challenge-description": "Output of challenge name 
and description. $1 is the challenge name, $2 is the challenge description",
-       "contest-submission-domains": "Shown above the form on the page that 
appears after the user submits initial details. $1 is a list of domains 
(defined in $egContestSettings['submissionDomains']) and $2 is the number of 
domains."
+       "contest-submission-domains": "Shown above the form on the page that 
appears after the user submits initial details. $1 is a list of domains 
(defined in $egContestSettings['submissionDomains']) and $2 is the number of 
domains.",
+       "apihelp-deletecontest-summary": 
"{{doc-apihelp-summary|deletecontest}}",
+       "apihelp-deletecontest-param-ids": 
"{{doc-apihelp-param|deletecontest|ids}}",
+       "apihelp-deletecontest-param-token": 
"{{doc-apihelp-param|deletecontest|token}}",
+       "apihelp-mailcontestants-summary": 
"{{doc-apihelp-summary|mailcontestants}}",
+       "apihelp-mailcontestants-extended-description": 
"{{doc-apihelp-extended-description|mailcontestants}}",
+       "apihelp-mailcontestants-param-page": 
"{{doc-apihelp-param|mailcontestants|page}}",
+       "apihelp-mailcontestants-param-ids": 
"{{doc-apihelp-param|mailcontestants|ids}}",
+       "apihelp-mailcontestants-param-contestids": 
"{{doc-apihelp-param|mailcontestants|contestids}}",
+       "apihelp-mailcontestants-param-contestnames": 
"{{doc-apihelp-param|mailcontestants|contestnames}}",
+       "apihelp-mailcontestants-param-challengeids": 
"{{doc-apihelp-param|mailcontestants|challengeids}}",
+       "apihelp-mailcontestants-param-challengetitles": 
"{{doc-apihelp-param|mailcontestants|challengetitles}}",
+       "apihelp-mailcontestants-param-token": 
"{{doc-apihelp-param|mailcontestants|token}}",
+       "apihelp-query+challenges-summary": 
"{{doc-apihelp-summary|challenges}}",
+       "apihelp-query+contestants-summary": 
"{{doc-apihelp-summary|contestants}}",
+       "apihelp-query+contestcomments-summary": 
"{{doc-apihelp-summary|contestcomments}}",
+       "apihelp-query+contests-summary": "{{doc-apihelp-summary|contests}}",
+       "apihelp-query+contestbase-param-props": 
"{{doc-apihelp-param|contestbase|props}}",
+       "apihelp-query+contestbase-param-continue": 
"{{doc-apihelp-param|contestbase|continue}}",
+       "apihelp-query+contestbase-param-limit": 
"{{doc-apihelp-param|contestbase|limit}}"
 }
\ No newline at end of file
diff --git a/includes/ContestDBObject.php b/includes/ContestDBObject.php
index 37378eb..3e2cff7 100644
--- a/includes/ContestDBObject.php
+++ b/includes/ContestDBObject.php
@@ -829,7 +829,8 @@
 
                        $params[$field] = array(
                                ApiBase::PARAM_TYPE => $typeMap[$type],
-                               ApiBase::PARAM_REQUIRED => $requireParams && 
!$hasDefault
+                               ApiBase::PARAM_REQUIRED => $requireParams && 
!$hasDefault,
+                               ApiBase::PARAM_HELP_MSG => 
'apihelp-query+contestbase-param-' . $field,
                        );
 
                        if ( $type == 'array' ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/369916
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I75e4624f151d3435484ad6e36edeb41ea0b83668
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Contest
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <umherirrender_de...@web.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to