Merge "rdbms: avoid LoadBalancer::getConnection waste when using $groups"
[lhc/web/wiklou.git] / tests / phpunit / includes / GlobalFunctions / wfUrlencodeTest.php
index d4df7b0..5d9f63d 100644 (file)
@@ -7,7 +7,7 @@
  * @covers ::wfUrlencode
  */
 class WfUrlencodeTest extends MediaWikiTestCase {
-       #### TESTS ##############################################################
+       # ### TESTS ##############################################################
 
        /**
         * @dataProvider provideURLS
@@ -23,20 +23,17 @@ class WfUrlencodeTest extends MediaWikiTestCase {
                $this->verifyEncodingFor( 'Microsoft-IIS/7', $input, $expected );
        }
 
-       #### HELPERS #############################################################
+       # ### HELPERS #############################################################
 
        /**
         * Internal helper that actually run the test.
         * Called by the public methods testEncodingUrlWith...()
-        *
         */
        private function verifyEncodingFor( $server, $input, $expectations ) {
                $expected = $this->extractExpect( $server, $expectations );
 
                // save up global
-               $old = isset( $_SERVER['SERVER_SOFTWARE'] )
-                       ? $_SERVER['SERVER_SOFTWARE']
-                       : null;
+               $old = $_SERVER['SERVER_SOFTWARE'] ?? null;
                $_SERVER['SERVER_SOFTWARE'] = $server;
                wfUrlencode( null );
 
@@ -76,51 +73,51 @@ class WfUrlencodeTest extends MediaWikiTestCase {
                }
        }
 
-       #### PROVIDERS ###########################################################
+       # ### PROVIDERS ###########################################################
 
        /**
         * Format is either:
-        *   array( 'input', 'expected' );
+        *   [ 'input', 'expected' ];
         * Or:
-        *   array( 'input',
-        *       array( 'Apache', 'expected' ),
-        *       array( 'Microsoft-IIS/7', 'expected' ),
-        *    ),
+        *   [ 'input',
+        *       [ 'Apache', 'expected' ],
+        *       [ 'Microsoft-IIS/7', 'expected' ],
+        *   ],
         * If you want to add other HTTP server name, you will have to add a new
         * testing method much like the testEncodingUrlWith() method above.
         */
        public static function provideURLS() {
-               return array(
-                       ### RFC 1738 chars
+               return [
+                       # ## RFC 1738 chars
                        // + is not safe
-                       array( '+', '%2B' ),
+                       [ '+', '%2B' ],
                        // & and = not safe in queries
-                       array( '&', '%26' ),
-                       array( '=', '%3D' ),
+                       [ '&', '%26' ],
+                       [ '=', '%3D' ],
 
-                       array( ':', array(
+                       [ ':', [
                                'Apache' => ':',
                                'Microsoft-IIS/7' => '%3A',
-                       ) ),
+                       ] ],
 
                        // remaining chars do not need encoding
-                       array(
+                       [
                                ';@$-_.!*',
                                ';@$-_.!*',
-                       ),
+                       ],
 
-                       ### Other tests
+                       # ## Other tests
                        // slash remain unchanged. %2F seems to break things
-                       array( '/', '/' ),
+                       [ '/', '/' ],
                        // T105265
-                       array( '~', '~' ),
+                       [ '~', '~' ],
 
                        // Other 'funnies' chars
-                       array( '[]', '%5B%5D' ),
-                       array( '<>', '%3C%3E' ),
+                       [ '[]', '%5B%5D' ],
+                       [ '<>', '%3C%3E' ],
 
                        // Apostrophe is encoded
-                       array( '\'', '%27' ),
-               );
+                       [ '\'', '%27' ],
+               ];
        }
 }