Aude has uploaded a new change for review.
https://gerrit.wikimedia.org/r/204510
Change subject: Update Wikidata tests for core api changes
......................................................................
Update Wikidata tests for core api changes
as far as I can tell, the actual output for api users
has not changed (yet) and still gets transformed to
use the '*'.
i tried with wbsetsitelink to trigger the badges
error, and with parsevalue and the output is the
same as before the core changes.
The extra '_idx="0"' in the xml format also shouldn't
be a problem, in my opinion.
We still need to remove use of all the deprecated
methods, etc.
Change-Id: I2172c51904213a3876f868babb3d714c31196139
---
M repo/tests/phpunit/data/api/getclaims.xml
M repo/tests/phpunit/data/api/getentities.xml
M repo/tests/phpunit/includes/api/ApiErrorReporterTest.php
M repo/tests/phpunit/includes/api/ParseValueTest.php
M repo/tests/phpunit/includes/api/SetSiteLinkTest.php
5 files changed, 13 insertions(+), 13 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase
refs/changes/10/204510/1
diff --git a/repo/tests/phpunit/data/api/getclaims.xml
b/repo/tests/phpunit/data/api/getclaims.xml
index 37cd157..54abe96 100644
--- a/repo/tests/phpunit/data/api/getclaims.xml
+++ b/repo/tests/phpunit/data/api/getclaims.xml
@@ -1 +1 @@
-<?xml version="1.0"?><api><claims><property id="P1491009"><claim
id="Q80050245$kittens" type="statement" rank="normal"><mainsnak
snaktype="novalue" property="P1491009" /><qualifiers /><qualifiers-order
/></claim></property></claims></api>
+<?xml version="1.0"?><api><claims><property id="P1491009"><claim _idx="0"
id="Q80050245$kittens" type="statement" rank="normal"><mainsnak
snaktype="novalue" property="P1491009" /><qualifiers /><qualifiers-order
/></claim></property></claims></api>
diff --git a/repo/tests/phpunit/data/api/getentities.xml
b/repo/tests/phpunit/data/api/getentities.xml
index 5f6ceb6..236bc6b 100644
--- a/repo/tests/phpunit/data/api/getentities.xml
+++ b/repo/tests/phpunit/data/api/getentities.xml
@@ -1 +1 @@
-<?xml version="1.0"?><api success="1"><entities><entity pageid="2276" ns="0"
title="Q80050245" lastrevid="4089" modified="2014-09-07T20:39:03Z"
id="Q80050245" type="item"><aliases /><labels /><descriptions
/><claims><property id="P1491009"><claim id="Q80050245$kittens"
type="statement" rank="normal"><mainsnak snaktype="novalue" property="P1491009"
/><qualifiers /><qualifiers-order /></claim></property></claims><sitelinks
/></entity></entities></api>
+<?xml version="1.0"?><api success="1"><entities><entity pageid="2276" ns="0"
title="Q80050245" lastrevid="4089" modified="2014-09-07T20:39:03Z"
id="Q80050245" type="item"><aliases /><labels /><descriptions
/><claims><property id="P1491009"><claim _idx="0" id="Q80050245$kittens"
type="statement" rank="normal"><mainsnak snaktype="novalue" property="P1491009"
/><qualifiers /><qualifiers-order /></claim></property></claims><sitelinks
/></entity></entities></api>
diff --git a/repo/tests/phpunit/includes/api/ApiErrorReporterTest.php
b/repo/tests/phpunit/includes/api/ApiErrorReporterTest.php
index 8458a42..3bfd0fe 100644
--- a/repo/tests/phpunit/includes/api/ApiErrorReporterTest.php
+++ b/repo/tests/phpunit/includes/api/ApiErrorReporterTest.php
@@ -109,7 +109,7 @@
'$expectedData' => array(
'fruit' => 'Banana',
'messages/0/name' =>
'wikibase-api-no-such-sitelink',
- 'messages/0/html/*' => '/gefunden/', //
in German
+ 'messages/0/html/content' =>
'/gefunden/', // in German
),
),
@@ -123,7 +123,7 @@
'$infoPattern' => '/^Malformed value\./',
'$expectedData' => array(
'messages/0/name' =>
'wikibase-parse-error',
- 'messages/0/html/*' => '/Wert/', // in
German
+ 'messages/0/html/content' => '/Wert/',
// in German
),
),
);
@@ -159,7 +159,7 @@
'$infoPattern' => '/sitelink/',
'$expectedDataFields' => array(
'messages/0/name' =>
'wikibase-api-no-such-sitelink',
- 'messages/0/html/*' => '/gefunden/', //
in German
+ 'messages/0/html/content' =>
'/gefunden/', // in German
'messages/0/parameters/0' => '/Foo/',
),
)
@@ -201,10 +201,10 @@
'$infoPattern' => '/sitelink/',
'$expectedData' => array(
'messages/0/name' =>
'wikibase-api-no-such-sitelink',
- 'messages/0/html/*' => '/gefunden/', //
in German
+ 'messages/0/html/content' =>
'/gefunden/', // in German
'messages/1/name' =>
'wikibase-noentity',
'messages/1/parameters/0' => 'Q123',
- 'messages/1/html/*' => '/ist nicht
vorhanden/', // in German
+ 'messages/1/html/content' => '/ist
nicht vorhanden/', // in German
),
),
@@ -297,9 +297,9 @@
'$status' => $status,
'$expectedData' => array(
'warnings/main_int/messages/0/name' =>
'wikibase-conflict-patched',
- 'warnings/main_int/messages/0/html/*'
=> '/Version/', // in German
+
'warnings/main_int/messages/0/html/content' => '/Version/', // in German
'warnings/main_int/messages/1/name' =>
'undo-nochange',
- 'warnings/main_int/messages/1/html/*'
=> '/Bearbeitung.*bereits/', // in German
+
'warnings/main_int/messages/1/html/content' => '/Bearbeitung.*bereits/', // in
German
),
),
);
@@ -315,7 +315,7 @@
$reporter->reportStatusWarnings( $status );
- $result = $api->getResult()->getData();
+ $result = $api->getResult()->getResultData();
foreach ( $expectedDataFields as $path => $value ) {
$path = explode( '/', $path );
diff --git a/repo/tests/phpunit/includes/api/ParseValueTest.php
b/repo/tests/phpunit/includes/api/ParseValueTest.php
index 4e67dab..f5dbea5 100644
--- a/repo/tests/phpunit/includes/api/ParseValueTest.php
+++ b/repo/tests/phpunit/includes/api/ParseValueTest.php
@@ -84,7 +84,7 @@
'0/error-info' => '/^.+$/',
'0/expected-format' => 'decimal',
'0/messages/0/name' =>
'wikibase-parse-error',
- '0/messages/0/html/*' => '/^.+$/',
+ '0/messages/0/html/content' => '/^.+$/',
),
),
@@ -97,7 +97,7 @@
'0/error-info' => '/^.+$/',
'0/expected-format' => 'decimal',
'0/messages/0/name' =>
'wikibase-parse-error',
- '0/messages/0/html/*' => '/^.+$/',
+ '0/messages/0/html/content' => '/^.+$/',
),
),
diff --git a/repo/tests/phpunit/includes/api/SetSiteLinkTest.php
b/repo/tests/phpunit/includes/api/SetSiteLinkTest.php
index 7b6ca74..6545277 100644
--- a/repo/tests/phpunit/includes/api/SetSiteLinkTest.php
+++ b/repo/tests/phpunit/includes/api/SetSiteLinkTest.php
@@ -347,7 +347,7 @@
list( $result, ) = $this->doApiRequestWithToken( $params );
- $warning = $result['warnings']['wbsetsitelink']['*'];
+ $warning = $result['warnings']['wbsetsitelink']['warnings'];
$this->assertRegExp( "/Unrecognized value for parameter
'badges'/", $warning );
}
--
To view, visit https://gerrit.wikimedia.org/r/204510
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2172c51904213a3876f868babb3d714c31196139
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Aude <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits