jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/369979 )

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


Add apihelp messages to pass unit tests

Bug: T155034
Change-Id: I7a3d1cec3c88fab158674f924f8f226308a19c72
---
M i18n/en.json
M i18n/qqq.json
M includes/apis/WOM_GetObjectModel.php
M includes/apis/WOM_GetWikiResult.php
M includes/apis/WOM_OutputObjectModel.php
M includes/apis/WOM_Query.php
M includes/apis/WOM_SetObjectModel.php
M includes/apis/WOM_WikiObjectApi.php
8 files changed, 116 insertions(+), 150 deletions(-)

Approvals:
  Umherirrender: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/i18n/en.json b/i18n/en.json
index 7c24802..c3f3072 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -4,5 +4,60 @@
        },
        "objecteditor": "Object Editor",
        "wom_editor": "Object Model",
-       "wom-desc": "Easy Page Object Model for wiki user"
+       "wom-desc": "Easy Page Object Model for wiki user",
+       "apihelp-womset-summary": "Call to set object values to MW page, by 
Wiki Object Model.",
+       "apihelp-womset-param-title": "Title of the page to modify.",
+       "apihelp-womset-param-verb": "Action verb to set to change wiki object 
instances.",
+       "apihelp-womset-param-xpath": "DOM-like xpath to locate WOM object 
instances (http://www.w3schools.com/xpath/xpath_syntax.asp)\n* verb = update, 
xpath to elements to be updated\n* verb = attribute, xpath to elements, the 
attribute will be updated\n* verb = insert, the element will be inserted right 
before the element specified by xpath\n* verb = append, the element will be 
appended right to the element children elements specified by xpath\n* verb = 
remove, xpath to element to be removed\n* verb = removeall, xpath to elements 
to be removed.",
+       "apihelp-womset-param-text": "Value to set\nverb = attribute, 
attribute_name=attribute_value",
+       "apihelp-womset-param-summary": "Edit summary.",
+       "apihelp-womset-param-rid": "Revision id of specified page - by default 
latest updated revision (0) is used.",
+       "apihelp-womset-param-force_update": "Force to update even if the 
revision id does not match the latest edition\n* force_update = false, return 
\"revision not match\" exception if rid is not the latest one\n* force_update = 
true, update anyway.",
+       "apihelp-womset-param-token": "Edit token. You can get one of these 
through prop=info.",
+       "apihelp-womset-param-minor": "Minor edit.",
+       "apihelp-womset-param-notminor": "Non-minor edit.",
+       "apihelp-womset-param-bot": "Mark this edit as bot.",
+       "apihelp-womset-param-basetimestamp": "Timestamp of the base revision 
(gotten through prop=revisions&rvprop=timestamp). Used to detect edit 
conflicts; leave unset to ignore conflicts.",
+       "apihelp-womset-param-starttimestamp": "Timestamp when you obtained the 
edit token. Used to detect edit conflicts; leave unset to ignore conflicts.",
+       "apihelp-womset-param-nocreate": "Throw an error if the page doesn't 
exist.",
+       "apihelp-womset-param-watch": "Add the page to your watchlist.",
+       "apihelp-womset-param-unwatch": "Remove the page from your watchlist.",
+       "apihelp-womset-param-watchlist": "Unconditionally add or remove the 
page from your watchlist, use preferences or do not change watch.",
+       "apihelp-womset-param-captchaid": "CAPTCHA ID from previous request.",
+       "apihelp-womset-param-captchaword": "Answer to the CAPTCHA.",
+       "apihelp-womset-param-md5": "The MD5 hash of the text parameter, or the 
prependtext and appendtext parameters concatenated. If set, the edit won't be 
done unless the hash is correct.",
+       "apihelp-womget-summary": "Call to get object values to Wiki Object 
Model.",
+       "apihelp-womget-param-title": "Title of the page to modify.",
+       "apihelp-womget-param-xpath": "DOM-like xpath to locate WOM object 
instances (http://www.w3schools.com/xpath/xpath_syntax.asp).",
+       "apihelp-womget-param-type": "Type to fetch useful wiki object data:",
+       "apihelp-womget-paramvalue-type-wiki": "Get wiki text of specified 
object.",
+       "apihelp-womget-paramvalue-type-count": "Get objects count with 
specified xpath.",
+       "apihelp-womget-paramvalue-type-xml": "View \"encoded objects' xml\" 
with specified xpath, usually use with format=xml",
+       "apihelp-womget-param-rid": "Revision id of specified page - by default 
latest updated revision (0) is used.",
+       "apihelp-womapi-summary": "Call to execute MW apis upon Wiki objects 
inside title.",
+       "apihelp-womapi-param-title": "Title of the page to modify.",
+       "apihelp-womapi-param-xpath": "DOM-like xpath to locate WOM object 
instances (http://www.w3schools.com/xpath/xpath_syntax.asp).",
+       "apihelp-womapi-param-wommap": "Settings to map WOM result on 
parameter(s) of api actions\n\"|\" as delimiter, to separate map items\nformat: 
xpath of values=api parameter name,other settings\n    for \"|\" inside map 
item, use \"||\" to escape\n    for \",\" inside map item, use \",,\" to 
escape\n  xpath:\n    \"@property\" as property name,\n    \"innerwiki\" as 
wiki text inside xml object\n  settings:\n    \"m<delimiter>\", multiple field, 
if multiple flag is not set, always use the first result,\n    \"p<prefix>\", 
prefix.",
+       "apihelp-womapi-param-api": "Api (action) name of common Wiki.",
+       "apihelp-womapi-param-rid": "Revision id of specified page - by default 
latest updated revision (0) is used.",
+       "apihelp-womapi-param-...": "Standard api parameters.",
+       "apihelp-womoutput-summary": "Call to get object values to Wiki Object 
Model.",
+       "apihelp-womoutput-param-title": "Title of the page to modify.",
+       "apihelp-womoutput-param-xpath": "DOM-like xpath to locate WOM object 
instances (http://www.w3schools.com/xpath/xpath_syntax.asp).",
+       "apihelp-womoutput-param-type": "Type to fetch useful wiki object 
data:",
+       "apihelp-womoutput-paramvalue-type-wiki": "Get wiki text of specified 
object.",
+       "apihelp-womoutput-paramvalue-type-count": "Get objects count with 
specified xpath.",
+       "apihelp-womoutput-paramvalue-type-xml": "View \"encoded objects' xml\" 
with specified xpath, usually use with format=xml",
+       "apihelp-womoutput-param-rid": "Revision id of specified page - by 
default latest updated revision (0) is used.",
+       "apihelp-womwiki-summary": "Call to get parse result of wiki.",
+       "apihelp-womwiki-param-wiki": "Wiki text.",
+       "apihelp-womwiki-param-type": "Type to fetch wiki parse result:",
+       "apihelp-womwiki-paramvalue-type-wiki": "Get parser result of wiki 
text.",
+       "apihelp-womwiki-paramvalue-type-ask": "Get parser result of ask 
query.",
+       "apihelp-womquery-summary": "Call to get objects to Wiki Object Model.",
+       "apihelp-womquery-param-title": "Title of the page to modify.",
+       "apihelp-womquery-param-key": "Query key.",
+       "apihelp-womquery-param-xpath": "DOM-like xpath to locate WOM object 
instances (http://www.w3schools.com/xpath/xpath_syntax.asp).",
+       "apihelp-womquery-param-type": "Object type to fetch useful wiki object 
data.",
+       "apihelp-womquery-param-rid": "Revision id of specified page - by 
default latest updated revision (0) is used."
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 929ddf3..4605353 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -8,5 +8,60 @@
        },
        "objecteditor": "Used as title on [[Special:Objecteditor]]",
        "wom_editor": "Name for the \"Object Model\"",
-       "wom-desc": "{{desc|name=Wiki Object 
Model|url=https://www.mediawiki.org/wiki/Extension:Wiki_Object_Model}}";
+       "wom-desc": "{{desc|name=Wiki Object 
Model|url=https://www.mediawiki.org/wiki/Extension:Wiki_Object_Model}}";,
+       "apihelp-womset-summary": "{{doc-apihelp-summary|womset}}",
+       "apihelp-womset-param-title": "{{doc-apihelp-param|womset|title}}",
+       "apihelp-womset-param-verb": "{{doc-apihelp-param|womset|verb}}",
+       "apihelp-womset-param-xpath": "{{doc-apihelp-param|womset|xpath}}",
+       "apihelp-womset-param-text": "{{doc-apihelp-param|womset|text}}",
+       "apihelp-womset-param-summary": "{{doc-apihelp-param|womset|summary}}",
+       "apihelp-womset-param-rid": "{{doc-apihelp-param|womset|rid}}",
+       "apihelp-womset-param-force_update": 
"{{doc-apihelp-param|womset|force_update}}",
+       "apihelp-womset-param-token": "{{doc-apihelp-param|womset|token}}",
+       "apihelp-womset-param-minor": "{{doc-apihelp-param|womset|minor}}",
+       "apihelp-womset-param-notminor": 
"{{doc-apihelp-param|womset|notminor}}",
+       "apihelp-womset-param-bot": "{{doc-apihelp-param|womset|bot}}",
+       "apihelp-womset-param-basetimestamp": 
"{{doc-apihelp-param|womset|basetimestamp}}",
+       "apihelp-womset-param-starttimestamp": 
"{{doc-apihelp-param|womset|starttimestamp}}",
+       "apihelp-womset-param-nocreate": 
"{{doc-apihelp-param|womset|nocreate}}",
+       "apihelp-womset-param-watch": "{{doc-apihelp-param|womset|watch}}",
+       "apihelp-womset-param-unwatch": "{{doc-apihelp-param|womset|unwatch}}",
+       "apihelp-womset-param-watchlist": 
"{{doc-apihelp-param|womset|watchlist}}",
+       "apihelp-womset-param-captchaid": 
"{{doc-apihelp-param|womset|captchaid}}",
+       "apihelp-womset-param-captchaword": 
"{{doc-apihelp-param|womset|captchaword}}",
+       "apihelp-womset-param-md5": "{{doc-apihelp-param|womset|md5}}",
+       "apihelp-womget-summary": "{{doc-apihelp-summary|womget}}",
+       "apihelp-womget-param-title": "{{doc-apihelp-param|womget|title}}",
+       "apihelp-womget-param-xpath": "{{doc-apihelp-param|womget|xpath}}",
+       "apihelp-womget-param-type": "{{doc-apihelp-param|womget|type}}",
+       "apihelp-womget-paramvalue-type-wiki": 
"{{doc-apihelp-paramvalue|womget|type|wiki}}",
+       "apihelp-womget-paramvalue-type-count": 
"{{doc-apihelp-paramvalue|womget|type|count}}",
+       "apihelp-womget-paramvalue-type-xml": 
"{{doc-apihelp-paramvalue|womget|type|xml}}",
+       "apihelp-womget-param-rid": "{{doc-apihelp-param|womget|rid}}",
+       "apihelp-womapi-summary": "{{doc-apihelp-summary|womapi}}",
+       "apihelp-womapi-param-title": "{{doc-apihelp-param|womapi|title}}",
+       "apihelp-womapi-param-xpath": "{{doc-apihelp-param|womapi|xpath}}",
+       "apihelp-womapi-param-wommap": "{{doc-apihelp-param|womapi|wommap}}",
+       "apihelp-womapi-param-api": "{{doc-apihelp-param|womapi|api}}",
+       "apihelp-womapi-param-rid": "{{doc-apihelp-param|womapi|rid}}",
+       "apihelp-womapi-param-...": "{{doc-apihelp-param|womapi|...}}",
+       "apihelp-womoutput-summary": "{{doc-apihelp-summary|womoutput}}",
+       "apihelp-womoutput-param-title": 
"{{doc-apihelp-param|womoutput|title}}",
+       "apihelp-womoutput-param-xpath": 
"{{doc-apihelp-param|womoutput|xpath}}",
+       "apihelp-womoutput-param-type": "{{doc-apihelp-param|womoutput|type}}",
+       "apihelp-womoutput-paramvalue-type-wiki": 
"{{doc-apihelp-paramvalue|womoutput|type|wiki}}",
+       "apihelp-womoutput-paramvalue-type-count": 
"{{doc-apihelp-paramvalue|womoutput|type|count}}",
+       "apihelp-womoutput-paramvalue-type-xml": 
"{{doc-apihelp-paramvalue|womoutput|type|xml}}",
+       "apihelp-womoutput-param-rid": "{{doc-apihelp-param|womoutput|rid}}",
+       "apihelp-womwiki-summary": "{{doc-apihelp-summary|womwiki}}",
+       "apihelp-womwiki-param-wiki": "{{doc-apihelp-param|womwiki|wiki}}",
+       "apihelp-womwiki-param-type": "{{doc-apihelp-param|womwiki|type}}",
+       "apihelp-womwiki-paramvalue-type-wiki": 
"{{doc-apihelp-paramvalue|womwiki|type|wiki}}",
+       "apihelp-womwiki-paramvalue-type-ask": 
"{{doc-apihelp-paramvalue|womwiki|type|ask}}",
+       "apihelp-womquery-summary": "{{doc-apihelp-summary|womquery}}",
+       "apihelp-womquery-param-title": "{{doc-apihelp-param|womquery|title}}",
+       "apihelp-womquery-param-key": "{{doc-apihelp-param|womquery|key}}",
+       "apihelp-womquery-param-xpath": "{{doc-apihelp-param|womquery|xpath}}",
+       "apihelp-womquery-param-type": "{{doc-apihelp-param|womquery|type}}",
+       "apihelp-womquery-param-rid": "{{doc-apihelp-param|womquery|rid}}"
 }
diff --git a/includes/apis/WOM_GetObjectModel.php 
b/includes/apis/WOM_GetObjectModel.php
index 3313900..609e554 100644
--- a/includes/apis/WOM_GetObjectModel.php
+++ b/includes/apis/WOM_GetObjectModel.php
@@ -115,6 +115,7 @@
                                        'count',
                                        'xml',
                                ),
+                               ApiBase::PARAM_HELP_MSG_PER_VALUE => [],
                        ),
                        'rid' => array (
                                 ApiBase :: PARAM_TYPE => 'integer',
@@ -122,24 +123,6 @@
                                 ApiBase :: PARAM_MIN => 0
                         ),
                );
-       }
-
-       protected function getParamDescription() {
-               return array (
-                       'title' => 'Title of the page to modify',
-                       'xpath' => 'DOM-like xpath to locate WOM object 
instances (http://www.w3schools.com/xpath/xpath_syntax.asp)',
-                       'type' => array (
-                               'Type to fetch useful wiki object data',
-                               'type = wiki, get wiki text of specified 
object',
-                               'type = count, get objects count with specified 
xpath',
-                               'type = xml, view "encoded objects\' xml" with 
specified xpath, usually use with format=xml',
-                       ),
-                       'rid' => 'Revision id of specified page - by dafault 
latest updated revision (0) is used',
-               );
-       }
-
-       protected function getDescription() {
-               return 'Call to get object values to Wiki Object Model';
        }
 
        protected function getExamples() {
diff --git a/includes/apis/WOM_GetWikiResult.php 
b/includes/apis/WOM_GetWikiResult.php
index 946c7c1..aeea93f 100644
--- a/includes/apis/WOM_GetWikiResult.php
+++ b/includes/apis/WOM_GetWikiResult.php
@@ -109,28 +109,10 @@
                        'wiki' => null,
                        'type' => array(
                                ApiBase :: PARAM_DFLT => 'wiki',
-                               ApiBase :: PARAM_TYPE => $types
+                               ApiBase :: PARAM_TYPE => $types,
+                               ApiBase :: PARAM_HELP_MSG_PER_VALUE => array(),
                        ),
                );
-       }
-
-       protected function getParamDescription() {
-               $types = defined( 'SMW_VERSION' ) ? array(
-                               'Type to fetch wiki parse result',
-                               'type = wiki, get parser result of wiki text',
-                               'type = ask, get parser result of ask query'
-                       ) : array(
-                               'Type to fetch wiki parse result',
-                               'type = wiki, get parser result of wiki text',
-                       );
-               return array (
-                       'wiki' => 'Wiki text',
-                       'type' => $types
-               );
-       }
-
-       protected function getDescription() {
-               return 'Call to get parse result of wiki';
        }
 
        protected function getExamples() {
diff --git a/includes/apis/WOM_OutputObjectModel.php 
b/includes/apis/WOM_OutputObjectModel.php
index 5e2a6c0..7455d39 100644
--- a/includes/apis/WOM_OutputObjectModel.php
+++ b/includes/apis/WOM_OutputObjectModel.php
@@ -116,6 +116,7 @@
                                        'count',
                                        'xml',
                                ),
+                               ApiBase::PARAM_HELP_MSG_PER_VALUE => [],
                        ),
                        'rid' => array (
                                 ApiBase :: PARAM_TYPE => 'integer',
@@ -123,24 +124,6 @@
                                 ApiBase :: PARAM_MIN => 0
                         ),
                );
-       }
-
-       protected function getParamDescription() {
-               return array (
-                       'title' => 'Title of the page to modify',
-                       'xpath' => 'DOM-like xpath to locate WOM object 
instances (http://www.w3schools.com/xpath/xpath_syntax.asp)',
-                       'type' => array (
-                               'Type to fetch useful wiki object data',
-                               'type = wiki, get wiki text of specified 
object',
-                               'type = count, get objects count with specified 
xpath',
-                               'type = xml, view "encoded objects\' xml" with 
specified xpath, usually use with format=xml',
-                       ),
-                       'rid' => 'Revision id of specified page - by dafault 
latest updated revision (0) is used',
-               );
-       }
-
-       protected function getDescription() {
-               return 'Call to get object values to Wiki Object Model';
        }
 
        protected function getExamples() {
diff --git a/includes/apis/WOM_Query.php b/includes/apis/WOM_Query.php
index 458ffb0..b5d950c 100644
--- a/includes/apis/WOM_Query.php
+++ b/includes/apis/WOM_Query.php
@@ -142,22 +142,6 @@
                );
        }
 
-       protected function getParamDescription() {
-               return array (
-                       'title' => 'Title of the page to modify',
-                       'key' => 'query key',
-                       'xpath' => 'DOM-like xpath to locate WOM object 
instances (http://www.w3schools.com/xpath/xpath_syntax.asp)',
-                       'type' => array (
-                               'Object type to fetch useful wiki object data',
-                       ),
-                       'rid' => 'Revision id of specified page - by dafault 
latest updated revision (0) is used',
-               );
-       }
-
-       protected function getDescription() {
-               return 'Call to get objects to Wiki Object Model';
-       }
-
        protected function getExamples() {
                return array (
                        'api.php?action=womquery&title=Somepage&key=hello,world'
diff --git a/includes/apis/WOM_SetObjectModel.php 
b/includes/apis/WOM_SetObjectModel.php
index eed4917..35f3178 100644
--- a/includes/apis/WOM_SetObjectModel.php
+++ b/includes/apis/WOM_SetObjectModel.php
@@ -352,55 +352,6 @@
                );
        }
 
-       protected function getParamDescription() {
-               return array (
-                       'title' => 'Title of the page to modify',
-                       'verb' => 'Action verb to set to change wiki object 
instances',
-                       'xpath' => array(
-                               'DOM-like xpath to locate WOM object instances 
(http://www.w3schools.com/xpath/xpath_syntax.asp)',
-                               'verb = update, xpath to elements to be 
updated',
-                               'verb = attribute, xpath to elements, the 
attribute will be updated',
-                               'verb = insert, the element will be inserted 
right before the element specified by xpath',
-                               'verb = append, the element will be appended 
right to the element children elements specified by xpath',
-                               'verb = remove, xpath to element to be removed',
-                               'verb = removeall, xpath to elements to be 
removed',
-                       ),
-                       'text' => array(
-                               'Value to set',
-                               'verb = attribute, 
attribute_name=attribute_value',
-                       ),
-                       'summary' => 'Edit summary',
-                       'rid' => 'Revision id of specified page - by dafault 
latest updated revision (0) is used',
-                       'force_update' => array(
-                               'Force to update even if the revision id does 
not match the latest edition',
-                               'force_update = false, return "revision not 
match" exception if rid is not the latest one',
-                               'force_update = true, update anyway',
-                       ),
-                       'token' => 'Edit token. You can get one of these 
through prop=info',
-                       'minor' => 'Minor edit',
-                       'notminor' => 'Non-minor edit',
-                       'bot' => 'Mark this edit as bot',
-                       'basetimestamp' => array( 'Timestamp of the base 
revision (gotten through prop=revisions&rvprop=timestamp).',
-                                               'Used to detect edit conflicts; 
leave unset to ignore conflicts.'
-                       ),
-                       'starttimestamp' => array( 'Timestamp when you obtained 
the edit token.',
-                                               'Used to detect edit conflicts; 
leave unset to ignore conflicts.'
-                       ),
-                       'nocreate' => 'Throw an error if the page doesn\'t 
exist',
-                       'watch' => 'Add the page to your watchlist',
-                       'unwatch' => 'Remove the page from your watchlist',
-                       'watchlist' => 'Unconditionally add or remove the page 
from your watchlist, use preferences or do not change watch',
-                       'captchaid' => 'CAPTCHA ID from previous request',
-                       'captchaword' => 'Answer to the CAPTCHA',
-                       'md5' => array( 'The MD5 hash of the text parameter, or 
the prependtext and appendtext parameters concatenated.',
-                                       'If set, the edit won\'t be done unless 
the hash is correct' ),
-               );
-       }
-
-       protected function getDescription() {
-               return 'Call to set object values to MW page, by Wiki Object 
Model';
-       }
-
        public function getTokenSalt() {
                return '';
        }
diff --git a/includes/apis/WOM_WikiObjectApi.php 
b/includes/apis/WOM_WikiObjectApi.php
index cd1a44d..190166d 100644
--- a/includes/apis/WOM_WikiObjectApi.php
+++ b/includes/apis/WOM_WikiObjectApi.php
@@ -170,33 +170,6 @@
                return $params;
        }
 
-       protected function getParamDescription() {
-               return array (
-                       'title' => 'Title of the page to modify',
-                       'xpath' => 'DOM-like xpath to locate WOM object 
instances (http://www.w3schools.com/xpath/xpath_syntax.asp)',
-                       'wommap' => array (
-                               'Settings to map WOM result on parameter(s) of 
api actions',
-                               '"|" as delimiter, to separate map items',
-                               'format: xpath of values=api parameter 
name,other settings',
-                               '    for "|" inside map item, use "||" to 
escape',
-                               '    for "," inside map item, use ",," to 
escape',
-                               '  xpath:',
-                               '    "@property" as property name,',
-                               '    "innerwiki" as wiki text inside xml 
object',
-                               '  settings:',
-                               '    "m<delimiter>", multiple field, if 
multiple flag is not set, always use the first result,',
-                               '    "p<prefix>", prefix',
-                       ),
-                       'api' => 'Api (action) name of common Wiki',
-                       'rid' => 'Revision id of specified page - by dafault 
latest updated revision (0) is used',
-                       '...' => 'standard api parameters',
-               );
-       }
-
-       protected function getDescription() {
-               return 'Call to execute MW apis upon Wiki objects inside title';
-       }
-
        protected function getExamples() {
                return array (
                        
'api.php?action=womapi&title=Somepage&xpath=//template&wommap=@name=titles,m||,ptemplate:&api=query&prop=info'

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7a3d1cec3c88fab158674f924f8f226308a19c72
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/WikiObjectModel
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <umherirrender_de...@web.de>
Gerrit-Reviewer: Siebrand <siebr...@kitano.nl>
Gerrit-Reviewer: Umherirrender <umherirrender_de...@web.de>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to