Exclude redirects from Special:Fewestrevisions
[lhc/web/wiklou.git] / tests / phpunit / includes / GlobalFunctions / wfAppendQueryTest.php
index 54e1f89..bb71610 100644 (file)
@@ -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'
+                       ]
+               ];
        }
 }