Aude has uploaded a new change for review.
https://gerrit.wikimedia.org/r/201487
Change subject: Drop support for xml format in Special:EntityData
......................................................................
Drop support for xml format in Special:EntityData
Bug: T93353
Change-Id: I3557793068f5050eddcc55dfa418aeab40dd127b
---
M repo/config/Wikibase.default.php
M repo/includes/LinkedData/EntityDataSerializationService.php
M repo/tests/phpunit/includes/LinkedData/EntityDataRequestHandlerTest.php
M repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceTest.php
M repo/tests/phpunit/includes/LinkedData/EntityDataTestProvider.php
5 files changed, 14 insertions(+), 36 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase
refs/changes/87/201487/1
diff --git a/repo/config/Wikibase.default.php b/repo/config/Wikibase.default.php
index 848be40..7a451b7 100644
--- a/repo/config/Wikibase.default.php
+++ b/repo/config/Wikibase.default.php
@@ -59,7 +59,6 @@
// using the API
'json', // default
'php',
- 'xml',
// using easyRdf
'rdfxml',
diff --git a/repo/includes/LinkedData/EntityDataSerializationService.php
b/repo/includes/LinkedData/EntityDataSerializationService.php
index e5965fc..15218eb 100644
--- a/repo/includes/LinkedData/EntityDataSerializationService.php
+++ b/repo/includes/LinkedData/EntityDataSerializationService.php
@@ -439,9 +439,6 @@
case 'txt':
return array( "text/text", "text/plain" );
- case 'xml':
- return array( "application/xml", "text/xml" );
-
case 'javascript':
return array( "text/javascript" );
@@ -569,19 +566,8 @@
// function gets called multiple times during testing, etc.
$res->reset();
- if ( $printer->getNeedsRawData() ) {
- // force raw mode, to trigger indexed tag names
- $res->setRawMode();
- }
-
//TODO: apply language filter/Fallback via options!
$options = new SerializationOptions();
-
- if ( $printer instanceof ApiFormatXml ) {
- $options->setIndexTags( true );
- // XXX: hack to force the top level element's name
- $printer->setRootElement( $entityKey );
- }
$resultBuilder = new ResultBuilder(
$res,
diff --git
a/repo/tests/phpunit/includes/LinkedData/EntityDataRequestHandlerTest.php
b/repo/tests/phpunit/includes/LinkedData/EntityDataRequestHandlerTest.php
index 7d953d8..3518241 100644
--- a/repo/tests/phpunit/includes/LinkedData/EntityDataRequestHandlerTest.php
+++ b/repo/tests/phpunit/includes/LinkedData/EntityDataRequestHandlerTest.php
@@ -104,7 +104,6 @@
// using the API
'json', // default
'php',
- 'xml',
// using easyRdf
'rdfxml',
@@ -118,7 +117,6 @@
// using the API
'json' => 'json', // default
'php' => 'php',
- 'xml' => 'xml',
// using easyRdf
'rdfxml' => 'rdf',
diff --git
a/repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceTest.php
b/repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceTest.php
index 7b42927..ed7c695 100644
---
a/repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceTest.php
+++
b/repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceTest.php
@@ -63,7 +63,6 @@
// using the API
'json', // default
'php',
- 'xml',
// using RdfWriter
'rdfxml',
@@ -101,19 +100,16 @@
private static $apiMimeTypes = array(
'application/vnd.php.serialized',
'application/json',
- 'text/xml'
);
private static $apiExtensions = array(
'php',
'json',
- 'xml'
);
private static $apiFormats = array(
'php',
'json',
- 'xml'
);
private static $rdfMimeTypes = array(
@@ -160,9 +156,6 @@
private static $formatMappings = array(
'json' => 'json', // should be api json
'application/json' => 'json', // should be api json
- 'xml' => 'xml', // should be api xml, not rdfxml
- 'text/xml' => 'xml', // should be api xml, not rdfxml
- 'application/xml' => 'xml', // should be api xml, not rdfxml
'application/rdf+xml' => 'rdfxml', // should be rdfxml
'text/n-triples' => 'ntriples', // should be ntriples
'text/plain' => 'ntriples', // should be ntriples
diff --git a/repo/tests/phpunit/includes/LinkedData/EntityDataTestProvider.php
b/repo/tests/phpunit/includes/LinkedData/EntityDataTestProvider.php
index eaddf6f..4df8e2d 100644
--- a/repo/tests/phpunit/includes/LinkedData/EntityDataTestProvider.php
+++ b/repo/tests/phpunit/includes/LinkedData/EntityDataTestProvider.php
@@ -141,17 +141,17 @@
415, // http code
);
- $cases[] = array( // #8: xml, redirected id
+ $cases[] = array( // #8: redirected id
'', // subpage
array( // parameters
'id' => 'Q22',
- 'format' => 'xml',
+ 'format' => 'application/json',
),
array(), // headers
- '!<entity!', // output regex
+ '!^\{.*Raarr!', // output regex
200, // http code
array( // headers
- 'Content-Type' => '!^text/xml(;|$)!'
+ 'Content-Type' => '!^application/json(;|$)!'
)
);
@@ -399,7 +399,7 @@
// #35: IMS from the deep bast should return a 200 (revision
timestamp is 20131211100908)
$cases[] = array(
- 'Q42.xml', // subpage
+ 'Q42.json', // subpage
array(), // parameters
array( // headers
'If-Modified-Since' => wfTimestamp( TS_RFC2822,
'20000101000000' )
@@ -419,6 +419,15 @@
304, // http code
);
+ // #37: invalid, no longer supported XML format
+ $cases[] = array(
+ 'Q42.xml',
+ array(),
+ array(),
+ '!!', // output regex
+ 415, // http code
+ );
+
return $cases;
}
@@ -433,13 +442,6 @@
$entityRev, // entityRev
'!^\{.*Raarrr!', // output regex
'application/json', // expected mime
- );
-
- $cases[] = array( // #1: xml
- 'xml', // format
- $entityRev, // entityRev
- '!<entity!', // output regex
- 'text/xml', // expected mime
);
return $cases;
--
To view, visit https://gerrit.wikimedia.org/r/201487
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3557793068f5050eddcc55dfa418aeab40dd127b
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