2014-12-17 21:48:03 +00:00
|
|
|
<?php
|
|
|
|
|
|
2023-03-01 20:33:26 +00:00
|
|
|
use MediaWiki\Title\Title;
|
|
|
|
|
|
2014-12-17 21:48:03 +00:00
|
|
|
/**
|
|
|
|
|
* @group API
|
|
|
|
|
* @group Database
|
2024-02-16 18:04:47 +00:00
|
|
|
* @covers \ApiFormatXml
|
2014-12-17 21:48:03 +00:00
|
|
|
*/
|
|
|
|
|
class ApiFormatXmlTest extends ApiFormatTestBase {
|
|
|
|
|
|
|
|
|
|
protected $printerName = 'xml';
|
|
|
|
|
|
2022-05-17 12:11:22 +00:00
|
|
|
protected function setUp(): void {
|
2022-02-18 07:02:52 +00:00
|
|
|
parent::setUp();
|
2022-08-05 19:39:42 +00:00
|
|
|
$performer = self::getTestSysop()->getAuthority();
|
2022-07-23 20:47:43 +00:00
|
|
|
$this->editPage(
|
|
|
|
|
Title::makeTitle( NS_MEDIAWIKI, 'ApiFormatXmlTest.xsl' ),
|
|
|
|
|
'<?xml version="1.0"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" />',
|
|
|
|
|
'Summary',
|
|
|
|
|
NS_MAIN,
|
2022-08-05 19:39:42 +00:00
|
|
|
$performer
|
2022-07-23 20:47:43 +00:00
|
|
|
);
|
|
|
|
|
$this->editPage(
|
|
|
|
|
Title::makeTitle( NS_MEDIAWIKI, 'ApiFormatXmlTest' ),
|
|
|
|
|
'Bogus',
|
|
|
|
|
'Summary',
|
|
|
|
|
NS_MAIN,
|
2022-08-05 19:39:42 +00:00
|
|
|
$performer
|
2022-07-23 20:47:43 +00:00
|
|
|
);
|
|
|
|
|
$this->editPage(
|
|
|
|
|
Title::makeTitle( NS_MAIN, 'ApiFormatXmlTest' ),
|
|
|
|
|
'Bogus',
|
|
|
|
|
'Summary',
|
|
|
|
|
NS_MAIN,
|
2022-08-05 19:39:42 +00:00
|
|
|
$performer
|
2022-07-23 20:47:43 +00:00
|
|
|
);
|
2014-12-17 21:48:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function provideGeneralEncoding() {
|
2016-03-19 01:05:19 +00:00
|
|
|
return [
|
2014-12-17 21:48:03 +00:00
|
|
|
// Basic types
|
2016-03-19 01:05:19 +00:00
|
|
|
[ [ null, 'a' => null ], '<?xml version="1.0"?><api><_v _idx="0" /></api>' ],
|
|
|
|
|
[ [ true, 'a' => true ], '<?xml version="1.0"?><api a=""><_v _idx="0">true</_v></api>' ],
|
|
|
|
|
[ [ false, 'a' => false ], '<?xml version="1.0"?><api><_v _idx="0">false</_v></api>' ],
|
|
|
|
|
[ [ true, 'a' => true, ApiResult::META_BC_BOOLS => [ 0, 'a' ] ],
|
|
|
|
|
'<?xml version="1.0"?><api a=""><_v _idx="0">1</_v></api>' ],
|
|
|
|
|
[ [ false, 'a' => false, ApiResult::META_BC_BOOLS => [ 0, 'a' ] ],
|
|
|
|
|
'<?xml version="1.0"?><api><_v _idx="0"></_v></api>' ],
|
|
|
|
|
[ [ 42, 'a' => 42 ], '<?xml version="1.0"?><api a="42"><_v _idx="0">42</_v></api>' ],
|
|
|
|
|
[ [ 42.5, 'a' => 42.5 ], '<?xml version="1.0"?><api a="42.5"><_v _idx="0">42.5</_v></api>' ],
|
|
|
|
|
[ [ 1e42, 'a' => 1e42 ], '<?xml version="1.0"?><api a="1.0E+42"><_v _idx="0">1.0E+42</_v></api>' ],
|
|
|
|
|
[ [ 'foo', 'a' => 'foo' ], '<?xml version="1.0"?><api a="foo"><_v _idx="0">foo</_v></api>' ],
|
|
|
|
|
[ [ 'fóo', 'a' => 'fóo' ], '<?xml version="1.0"?><api a="fóo"><_v _idx="0">fóo</_v></api>' ],
|
2014-12-17 21:48:03 +00:00
|
|
|
|
|
|
|
|
// Arrays and objects
|
2016-03-19 01:05:19 +00:00
|
|
|
[ [ [] ], '<?xml version="1.0"?><api><_v /></api>' ],
|
|
|
|
|
[ [ [ 'x' => 1 ] ], '<?xml version="1.0"?><api><_v x="1" /></api>' ],
|
|
|
|
|
[ [ [ 2 => 1 ] ], '<?xml version="1.0"?><api><_v><_v _idx="2">1</_v></_v></api>' ],
|
|
|
|
|
[ [ (object)[] ], '<?xml version="1.0"?><api><_v /></api>' ],
|
|
|
|
|
[ [ [ 1, ApiResult::META_TYPE => 'assoc' ] ], '<?xml version="1.0"?><api><_v><_v _idx="0">1</_v></_v></api>' ],
|
|
|
|
|
[ [ [ 'x' => 1, ApiResult::META_TYPE => 'array' ] ], '<?xml version="1.0"?><api><_v><_v>1</_v></_v></api>' ],
|
|
|
|
|
[ [ [ 'x' => 1, 'y' => [ 'z' => 1 ], ApiResult::META_TYPE => 'kvp' ] ],
|
|
|
|
|
'<?xml version="1.0"?><api><_v><_v _name="x" xml:space="preserve">1</_v><_v _name="y"><z xml:space="preserve">1</z></_v></_v></api>' ],
|
|
|
|
|
[ [ [ 'x' => 1, ApiResult::META_TYPE => 'kvp', ApiResult::META_INDEXED_TAG_NAME => 'i', ApiResult::META_KVP_KEY_NAME => 'key' ] ],
|
|
|
|
|
'<?xml version="1.0"?><api><_v><i key="x" xml:space="preserve">1</i></_v></api>' ],
|
|
|
|
|
[ [ [ 'x' => 1, ApiResult::META_TYPE => 'BCkvp', ApiResult::META_KVP_KEY_NAME => 'key' ] ],
|
|
|
|
|
'<?xml version="1.0"?><api><_v><_v key="x" xml:space="preserve">1</_v></_v></api>' ],
|
|
|
|
|
[ [ [ 'x' => 1, ApiResult::META_TYPE => 'BCarray' ] ], '<?xml version="1.0"?><api><_v x="1" /></api>' ],
|
|
|
|
|
[ [ [ 'a', 'b', ApiResult::META_TYPE => 'BCassoc' ] ], '<?xml version="1.0"?><api><_v><_v _idx="0">a</_v><_v _idx="1">b</_v></_v></api>' ],
|
2014-12-17 21:48:03 +00:00
|
|
|
|
|
|
|
|
// Content
|
2016-03-19 01:05:19 +00:00
|
|
|
[ [ 'content' => 'foo', ApiResult::META_CONTENT => 'content' ],
|
|
|
|
|
'<?xml version="1.0"?><api xml:space="preserve">foo</api>' ],
|
API: Overhaul ApiResult, make format=xml not throw, and add json formatversion
ApiResult was a mess: some methods could only be used with an array
reference instead of manipulating the stored data, methods that had both
array-ref and internal-data versions had names that didn't at all
correspond, some methods that worked on an array reference were
annoyingly non-static, and then the whole mess with setIndexedTagName.
ApiFormatXml is also entirely annoying to deal with, as it liked to
throw exceptions if certain metadata wasn't provided that no other
formatter required. Its legacy also means we have this silly convention
of using empty-string rather than boolean true, annoying restrictions on
keys (leading to things that should be hashes being arrays of key-value
object instead), '*' used as a key all over the place, and so on.
So, changes here:
* ApiResult is no longer an ApiBase or a ContextSource.
* Wherever sensible, ApiResult provides a static method working on an
arrayref and a non-static method working on internal data.
* Metadata is now always added to ApiResult's internal data structure.
Formatters are responsible for stripping it if necessary. "raw mode"
is deprecated.
* New metadata to replace the '*' key, solve the array() => '[]' vs '{}'
question, and so on.
* New class for formatting warnings and errors using i18n messages, and
support for multiple errors and a more machine-readable format for
warnings. For the moment, though, the actual output will not be changing
yet (see T47843 for future plans).
* New formatversion parameter for format=json and format=php, to select
between BC mode and the modern output.
* In BC mode, booleans will be converted to empty-string presence style;
modules currently returning booleans will need to use
ApiResult::META_BC_BOOLS to preserve their current output.
Actual changes to the API modules' output (e.g. actually returning
booleans for the new formatversion) beyond the use of
ApiResult::setContentValue() are left for a future change.
Bug: T76728
Bug: T57371
Bug: T33629
Change-Id: I7b37295e8862b188d1f3b0cd07f66ac34629678f
2014-12-03 22:14:22 +00:00
|
|
|
|
|
|
|
|
// Specified element name
|
2016-03-19 01:05:19 +00:00
|
|
|
[ [ 'foo', 'bar', ApiResult::META_INDEXED_TAG_NAME => 'itn' ],
|
|
|
|
|
'<?xml version="1.0"?><api><itn>foo</itn><itn>bar</itn></api>' ],
|
2014-12-17 21:48:03 +00:00
|
|
|
|
|
|
|
|
// Subelements
|
2016-03-19 01:05:19 +00:00
|
|
|
[ [ 'a' => 1, 's' => 1, '_subelements' => [ 's' ] ],
|
|
|
|
|
'<?xml version="1.0"?><api a="1"><s xml:space="preserve">1</s></api>' ],
|
2014-12-17 21:48:03 +00:00
|
|
|
|
API: Overhaul ApiResult, make format=xml not throw, and add json formatversion
ApiResult was a mess: some methods could only be used with an array
reference instead of manipulating the stored data, methods that had both
array-ref and internal-data versions had names that didn't at all
correspond, some methods that worked on an array reference were
annoyingly non-static, and then the whole mess with setIndexedTagName.
ApiFormatXml is also entirely annoying to deal with, as it liked to
throw exceptions if certain metadata wasn't provided that no other
formatter required. Its legacy also means we have this silly convention
of using empty-string rather than boolean true, annoying restrictions on
keys (leading to things that should be hashes being arrays of key-value
object instead), '*' used as a key all over the place, and so on.
So, changes here:
* ApiResult is no longer an ApiBase or a ContextSource.
* Wherever sensible, ApiResult provides a static method working on an
arrayref and a non-static method working on internal data.
* Metadata is now always added to ApiResult's internal data structure.
Formatters are responsible for stripping it if necessary. "raw mode"
is deprecated.
* New metadata to replace the '*' key, solve the array() => '[]' vs '{}'
question, and so on.
* New class for formatting warnings and errors using i18n messages, and
support for multiple errors and a more machine-readable format for
warnings. For the moment, though, the actual output will not be changing
yet (see T47843 for future plans).
* New formatversion parameter for format=json and format=php, to select
between BC mode and the modern output.
* In BC mode, booleans will be converted to empty-string presence style;
modules currently returning booleans will need to use
ApiResult::META_BC_BOOLS to preserve their current output.
Actual changes to the API modules' output (e.g. actually returning
booleans for the new formatversion) beyond the use of
ApiResult::setContentValue() are left for a future change.
Bug: T76728
Bug: T57371
Bug: T33629
Change-Id: I7b37295e8862b188d1f3b0cd07f66ac34629678f
2014-12-03 22:14:22 +00:00
|
|
|
// Content and subelement
|
2016-03-19 01:05:19 +00:00
|
|
|
[ [ 'a' => 1, 'content' => 'foo', ApiResult::META_CONTENT => 'content' ],
|
|
|
|
|
'<?xml version="1.0"?><api a="1" xml:space="preserve">foo</api>' ],
|
|
|
|
|
[ [ 's' => [], 'content' => 'foo', ApiResult::META_CONTENT => 'content' ],
|
|
|
|
|
'<?xml version="1.0"?><api><s /><content xml:space="preserve">foo</content></api>' ],
|
|
|
|
|
[
|
|
|
|
|
[
|
API: Overhaul ApiResult, make format=xml not throw, and add json formatversion
ApiResult was a mess: some methods could only be used with an array
reference instead of manipulating the stored data, methods that had both
array-ref and internal-data versions had names that didn't at all
correspond, some methods that worked on an array reference were
annoyingly non-static, and then the whole mess with setIndexedTagName.
ApiFormatXml is also entirely annoying to deal with, as it liked to
throw exceptions if certain metadata wasn't provided that no other
formatter required. Its legacy also means we have this silly convention
of using empty-string rather than boolean true, annoying restrictions on
keys (leading to things that should be hashes being arrays of key-value
object instead), '*' used as a key all over the place, and so on.
So, changes here:
* ApiResult is no longer an ApiBase or a ContextSource.
* Wherever sensible, ApiResult provides a static method working on an
arrayref and a non-static method working on internal data.
* Metadata is now always added to ApiResult's internal data structure.
Formatters are responsible for stripping it if necessary. "raw mode"
is deprecated.
* New metadata to replace the '*' key, solve the array() => '[]' vs '{}'
question, and so on.
* New class for formatting warnings and errors using i18n messages, and
support for multiple errors and a more machine-readable format for
warnings. For the moment, though, the actual output will not be changing
yet (see T47843 for future plans).
* New formatversion parameter for format=json and format=php, to select
between BC mode and the modern output.
* In BC mode, booleans will be converted to empty-string presence style;
modules currently returning booleans will need to use
ApiResult::META_BC_BOOLS to preserve their current output.
Actual changes to the API modules' output (e.g. actually returning
booleans for the new formatversion) beyond the use of
ApiResult::setContentValue() are left for a future change.
Bug: T76728
Bug: T57371
Bug: T33629
Change-Id: I7b37295e8862b188d1f3b0cd07f66ac34629678f
2014-12-03 22:14:22 +00:00
|
|
|
's' => 1,
|
|
|
|
|
'content' => 'foo',
|
|
|
|
|
ApiResult::META_CONTENT => 'content',
|
2016-03-19 01:05:19 +00:00
|
|
|
ApiResult::META_SUBELEMENTS => [ 's' ]
|
|
|
|
|
],
|
API: Overhaul ApiResult, make format=xml not throw, and add json formatversion
ApiResult was a mess: some methods could only be used with an array
reference instead of manipulating the stored data, methods that had both
array-ref and internal-data versions had names that didn't at all
correspond, some methods that worked on an array reference were
annoyingly non-static, and then the whole mess with setIndexedTagName.
ApiFormatXml is also entirely annoying to deal with, as it liked to
throw exceptions if certain metadata wasn't provided that no other
formatter required. Its legacy also means we have this silly convention
of using empty-string rather than boolean true, annoying restrictions on
keys (leading to things that should be hashes being arrays of key-value
object instead), '*' used as a key all over the place, and so on.
So, changes here:
* ApiResult is no longer an ApiBase or a ContextSource.
* Wherever sensible, ApiResult provides a static method working on an
arrayref and a non-static method working on internal data.
* Metadata is now always added to ApiResult's internal data structure.
Formatters are responsible for stripping it if necessary. "raw mode"
is deprecated.
* New metadata to replace the '*' key, solve the array() => '[]' vs '{}'
question, and so on.
* New class for formatting warnings and errors using i18n messages, and
support for multiple errors and a more machine-readable format for
warnings. For the moment, though, the actual output will not be changing
yet (see T47843 for future plans).
* New formatversion parameter for format=json and format=php, to select
between BC mode and the modern output.
* In BC mode, booleans will be converted to empty-string presence style;
modules currently returning booleans will need to use
ApiResult::META_BC_BOOLS to preserve their current output.
Actual changes to the API modules' output (e.g. actually returning
booleans for the new formatversion) beyond the use of
ApiResult::setContentValue() are left for a future change.
Bug: T76728
Bug: T57371
Bug: T33629
Change-Id: I7b37295e8862b188d1f3b0cd07f66ac34629678f
2014-12-03 22:14:22 +00:00
|
|
|
'<?xml version="1.0"?><api><s xml:space="preserve">1</s><content xml:space="preserve">foo</content></api>'
|
2016-03-19 01:05:19 +00:00
|
|
|
],
|
API: Overhaul ApiResult, make format=xml not throw, and add json formatversion
ApiResult was a mess: some methods could only be used with an array
reference instead of manipulating the stored data, methods that had both
array-ref and internal-data versions had names that didn't at all
correspond, some methods that worked on an array reference were
annoyingly non-static, and then the whole mess with setIndexedTagName.
ApiFormatXml is also entirely annoying to deal with, as it liked to
throw exceptions if certain metadata wasn't provided that no other
formatter required. Its legacy also means we have this silly convention
of using empty-string rather than boolean true, annoying restrictions on
keys (leading to things that should be hashes being arrays of key-value
object instead), '*' used as a key all over the place, and so on.
So, changes here:
* ApiResult is no longer an ApiBase or a ContextSource.
* Wherever sensible, ApiResult provides a static method working on an
arrayref and a non-static method working on internal data.
* Metadata is now always added to ApiResult's internal data structure.
Formatters are responsible for stripping it if necessary. "raw mode"
is deprecated.
* New metadata to replace the '*' key, solve the array() => '[]' vs '{}'
question, and so on.
* New class for formatting warnings and errors using i18n messages, and
support for multiple errors and a more machine-readable format for
warnings. For the moment, though, the actual output will not be changing
yet (see T47843 for future plans).
* New formatversion parameter for format=json and format=php, to select
between BC mode and the modern output.
* In BC mode, booleans will be converted to empty-string presence style;
modules currently returning booleans will need to use
ApiResult::META_BC_BOOLS to preserve their current output.
Actual changes to the API modules' output (e.g. actually returning
booleans for the new formatversion) beyond the use of
ApiResult::setContentValue() are left for a future change.
Bug: T76728
Bug: T57371
Bug: T33629
Change-Id: I7b37295e8862b188d1f3b0cd07f66ac34629678f
2014-12-03 22:14:22 +00:00
|
|
|
|
|
|
|
|
// BC Subelements
|
2016-03-19 01:05:19 +00:00
|
|
|
[ [ 'foo' => 'foo', ApiResult::META_BC_SUBELEMENTS => [ 'foo' ] ],
|
|
|
|
|
'<?xml version="1.0"?><api><foo xml:space="preserve">foo</foo></api>' ],
|
API: Overhaul ApiResult, make format=xml not throw, and add json formatversion
ApiResult was a mess: some methods could only be used with an array
reference instead of manipulating the stored data, methods that had both
array-ref and internal-data versions had names that didn't at all
correspond, some methods that worked on an array reference were
annoyingly non-static, and then the whole mess with setIndexedTagName.
ApiFormatXml is also entirely annoying to deal with, as it liked to
throw exceptions if certain metadata wasn't provided that no other
formatter required. Its legacy also means we have this silly convention
of using empty-string rather than boolean true, annoying restrictions on
keys (leading to things that should be hashes being arrays of key-value
object instead), '*' used as a key all over the place, and so on.
So, changes here:
* ApiResult is no longer an ApiBase or a ContextSource.
* Wherever sensible, ApiResult provides a static method working on an
arrayref and a non-static method working on internal data.
* Metadata is now always added to ApiResult's internal data structure.
Formatters are responsible for stripping it if necessary. "raw mode"
is deprecated.
* New metadata to replace the '*' key, solve the array() => '[]' vs '{}'
question, and so on.
* New class for formatting warnings and errors using i18n messages, and
support for multiple errors and a more machine-readable format for
warnings. For the moment, though, the actual output will not be changing
yet (see T47843 for future plans).
* New formatversion parameter for format=json and format=php, to select
between BC mode and the modern output.
* In BC mode, booleans will be converted to empty-string presence style;
modules currently returning booleans will need to use
ApiResult::META_BC_BOOLS to preserve their current output.
Actual changes to the API modules' output (e.g. actually returning
booleans for the new formatversion) beyond the use of
ApiResult::setContentValue() are left for a future change.
Bug: T76728
Bug: T57371
Bug: T33629
Change-Id: I7b37295e8862b188d1f3b0cd07f66ac34629678f
2014-12-03 22:14:22 +00:00
|
|
|
|
|
|
|
|
// Name mangling
|
2016-03-19 01:05:19 +00:00
|
|
|
[ [ 'foo.bar' => 1 ], '<?xml version="1.0"?><api foo.bar="1" />' ],
|
|
|
|
|
[ [ '' => 1 ], '<?xml version="1.0"?><api _="1" />' ],
|
|
|
|
|
[ [ 'foo bar' => 1 ], '<?xml version="1.0"?><api _foo.20.bar="1" />' ],
|
|
|
|
|
[ [ 'foo:bar' => 1 ], '<?xml version="1.0"?><api _foo.3A.bar="1" />' ],
|
|
|
|
|
[ [ 'foo%.bar' => 1 ], '<?xml version="1.0"?><api _foo.25..2E.bar="1" />' ],
|
|
|
|
|
[ [ '4foo' => 1, 'foo4' => 1 ], '<?xml version="1.0"?><api _4foo="1" foo4="1" />' ],
|
|
|
|
|
[ [ "foo\xe3\x80\x80bar" => 1 ], '<?xml version="1.0"?><api _foo.3000.bar="1" />' ],
|
|
|
|
|
[ [ 'foo:bar' => 1, ApiResult::META_PRESERVE_KEYS => [ 'foo:bar' ] ],
|
|
|
|
|
'<?xml version="1.0"?><api foo:bar="1" />' ],
|
|
|
|
|
[ [ 'a', 'b', ApiResult::META_INDEXED_TAG_NAME => 'foo bar' ],
|
|
|
|
|
'<?xml version="1.0"?><api><_foo.20.bar>a</_foo.20.bar><_foo.20.bar>b</_foo.20.bar></api>' ],
|
API: Overhaul ApiResult, make format=xml not throw, and add json formatversion
ApiResult was a mess: some methods could only be used with an array
reference instead of manipulating the stored data, methods that had both
array-ref and internal-data versions had names that didn't at all
correspond, some methods that worked on an array reference were
annoyingly non-static, and then the whole mess with setIndexedTagName.
ApiFormatXml is also entirely annoying to deal with, as it liked to
throw exceptions if certain metadata wasn't provided that no other
formatter required. Its legacy also means we have this silly convention
of using empty-string rather than boolean true, annoying restrictions on
keys (leading to things that should be hashes being arrays of key-value
object instead), '*' used as a key all over the place, and so on.
So, changes here:
* ApiResult is no longer an ApiBase or a ContextSource.
* Wherever sensible, ApiResult provides a static method working on an
arrayref and a non-static method working on internal data.
* Metadata is now always added to ApiResult's internal data structure.
Formatters are responsible for stripping it if necessary. "raw mode"
is deprecated.
* New metadata to replace the '*' key, solve the array() => '[]' vs '{}'
question, and so on.
* New class for formatting warnings and errors using i18n messages, and
support for multiple errors and a more machine-readable format for
warnings. For the moment, though, the actual output will not be changing
yet (see T47843 for future plans).
* New formatversion parameter for format=json and format=php, to select
between BC mode and the modern output.
* In BC mode, booleans will be converted to empty-string presence style;
modules currently returning booleans will need to use
ApiResult::META_BC_BOOLS to preserve their current output.
Actual changes to the API modules' output (e.g. actually returning
booleans for the new formatversion) beyond the use of
ApiResult::setContentValue() are left for a future change.
Bug: T76728
Bug: T57371
Bug: T33629
Change-Id: I7b37295e8862b188d1f3b0cd07f66ac34629678f
2014-12-03 22:14:22 +00:00
|
|
|
|
2014-12-17 21:48:03 +00:00
|
|
|
// includenamespace param
|
2016-03-19 01:05:19 +00:00
|
|
|
[ [ 'x' => 'foo' ], '<?xml version="1.0"?><api x="foo" xmlns="http://www.mediawiki.org/xml/api/" />',
|
|
|
|
|
[ 'includexmlnamespace' => 1 ] ],
|
2014-12-17 21:48:03 +00:00
|
|
|
|
|
|
|
|
// xslt param
|
2016-10-19 16:54:25 +00:00
|
|
|
[ [], '<?xml version="1.0"?><api><warnings><xml xml:space="preserve">Invalid or non-existent stylesheet specified.</xml></warnings></api>',
|
2016-03-19 01:05:19 +00:00
|
|
|
[ 'xslt' => 'DoesNotExist' ] ],
|
|
|
|
|
[ [], '<?xml version="1.0"?><api><warnings><xml xml:space="preserve">Stylesheet should be in the MediaWiki namespace.</xml></warnings></api>',
|
|
|
|
|
[ 'xslt' => 'ApiFormatXmlTest' ] ],
|
2016-02-24 18:22:43 +00:00
|
|
|
[ [], '<?xml version="1.0"?><api><warnings><xml xml:space="preserve">Stylesheet should have ".xsl" extension.</xml></warnings></api>',
|
2016-03-19 01:05:19 +00:00
|
|
|
[ 'xslt' => 'MediaWiki:ApiFormatXmlTest' ] ],
|
|
|
|
|
[ [],
|
2014-12-17 21:48:03 +00:00
|
|
|
'<?xml version="1.0"?><?xml-stylesheet href="' .
|
2022-09-23 19:53:11 +00:00
|
|
|
htmlspecialchars( Title::makeTitle( NS_MEDIAWIKI, 'ApiFormatXmlTest.xsl' )->getLocalURL( 'action=raw' ) ) .
|
2014-12-17 21:48:03 +00:00
|
|
|
'" type="text/xsl" ?><api />',
|
2016-03-19 01:05:19 +00:00
|
|
|
[ 'xslt' => 'MediaWiki:ApiFormatXmlTest.xsl' ] ],
|
|
|
|
|
];
|
2018-01-01 13:10:16 +00:00
|
|
|
// phpcs:enable
|
2014-12-17 21:48:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|