X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FGlobalFunctions%2FwfAppendQueryTest.php;h=bb71610b64e7c9b5c94b6bfda24089c2b4250b0e;hb=767042c3e68adb29513;hp=54e1f896e7bb134b08b974961e80286abefb8cfa;hpb=d5aac726d092b30545f92a8936b3ddbe907213d7;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/GlobalFunctions/wfAppendQueryTest.php b/tests/phpunit/includes/GlobalFunctions/wfAppendQueryTest.php index 54e1f896e7..bb71610b64 100644 --- a/tests/phpunit/includes/GlobalFunctions/wfAppendQueryTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfAppendQueryTest.php @@ -13,55 +13,67 @@ class WfAppendQueryTest extends MediaWikiTestCase { } public static function provideAppendQuery() { - return array( - array( + return [ + [ 'http://www.example.org/index.php', '', 'http://www.example.org/index.php', 'No query' - ), - array( + ], + [ 'http://www.example.org/index.php', - array( 'foo' => 'bar' ), + [ 'foo' => 'bar' ], 'http://www.example.org/index.php?foo=bar', 'Set query array' - ), - array( + ], + [ 'http://www.example.org/index.php?foz=baz', 'foo=bar', 'http://www.example.org/index.php?foz=baz&foo=bar', 'Set query string' - ), - array( + ], + [ 'http://www.example.org/index.php?foo=bar', '', 'http://www.example.org/index.php?foo=bar', 'Empty string with query' - ), - array( + ], + [ 'http://www.example.org/index.php?foo=bar', - array( 'baz' => 'quux' ), + [ 'baz' => 'quux' ], 'http://www.example.org/index.php?foo=bar&baz=quux', 'Add query array' - ), - array( + ], + [ 'http://www.example.org/index.php?foo=bar', 'baz=quux', 'http://www.example.org/index.php?foo=bar&baz=quux', 'Add query string' - ), - array( + ], + [ 'http://www.example.org/index.php?foo=bar', - array( 'baz' => 'quux', 'foo' => 'baz' ), + [ 'baz' => 'quux', 'foo' => 'baz' ], 'http://www.example.org/index.php?foo=bar&baz=quux&foo=baz', 'Modify query array' - ), - array( + ], + [ 'http://www.example.org/index.php?foo=bar', 'baz=quux&foo=baz', 'http://www.example.org/index.php?foo=bar&baz=quux&foo=baz', 'Modify query string' - ) - ); + ], + [ + 'http://www.example.org/index.php#baz', + 'foo=bar', + 'http://www.example.org/index.php?foo=bar#baz', + 'URL with fragment' + ], + [ + 'http://www.example.org/index.php?foo=bar#baz', + 'quux=blah', + 'http://www.example.org/index.php?foo=bar&quux=blah#baz', + 'URL with query string and fragment' + ] + ]; } }