X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FGlobalFunctions%2FwfUrlencodeTest.php;h=09c1040b2f1d390cff688c54901f3cbd2b999f42;hb=732b5e2745ca8f6153e19cc10c3c9acb1b2a6331;hp=92115b03ab4636a52c358fbd5009571250ee4ee4;hpb=cb2896f90ebef77c02c9da4067b0e56e37471092;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/GlobalFunctions/wfUrlencodeTest.php b/tests/phpunit/includes/GlobalFunctions/wfUrlencodeTest.php index 92115b03ab..09c1040b2f 100644 --- a/tests/phpunit/includes/GlobalFunctions/wfUrlencodeTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfUrlencodeTest.php @@ -28,7 +28,6 @@ class WfUrlencodeTest extends MediaWikiTestCase { /** * Internal helper that actually run the test. * Called by the public methods testEncodingUrlWith...() - * */ private function verifyEncodingFor( $server, $input, $expectations ) { $expected = $this->extractExpect( $server, $expectations ); @@ -80,47 +79,47 @@ class WfUrlencodeTest extends MediaWikiTestCase { /** * 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( + 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 // 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' ], + ]; } }