X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FGlobalFunctions%2FwfParseUrlTest.php;h=b20cfb5c22b0760795ca1acd8e8674725c360291;hb=8956885666e4678a8ff76f7310396d2b2874a858;hp=af834f8dc42475dbc20e817debd6a44a15c194d8;hpb=1d9c11aba4b2b91018db373bfb618ee24a2eeac5;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/GlobalFunctions/wfParseUrlTest.php b/tests/phpunit/includes/GlobalFunctions/wfParseUrlTest.php index af834f8dc4..b20cfb5c22 100644 --- a/tests/phpunit/includes/GlobalFunctions/wfParseUrlTest.php +++ b/tests/phpunit/includes/GlobalFunctions/wfParseUrlTest.php @@ -21,19 +21,20 @@ */ /** + * @group GlobalFunctions * @covers ::wfParseUrl */ class WfParseUrlTest extends MediaWikiTestCase { protected function setUp() { parent::setUp(); - $this->setMwGlobals( 'wgUrlProtocols', array( + $this->setMwGlobals( 'wgUrlProtocols', [ '//', 'http://', 'https://', 'file://', 'mailto:', - ) ); + ] ); } /** @@ -52,34 +53,34 @@ class WfParseUrlTest extends MediaWikiTestCase { * @return array */ public static function provideURLs() { - return array( - array( + return [ + [ '//example.org', - array( + [ 'scheme' => '', 'delimiter' => '//', 'host' => 'example.org', - ) - ), - array( + ] + ], + [ 'http://example.org', - array( + [ 'scheme' => 'http', 'delimiter' => '://', 'host' => 'example.org', - ) - ), - array( + ] + ], + [ 'https://example.org', - array( + [ 'scheme' => 'https', 'delimiter' => '://', 'host' => 'example.org', - ) - ), - array( + ] + ], + [ 'http://id:key@example.org:123/path?foo=bar#baz', - array( + [ 'scheme' => 'http', 'delimiter' => '://', 'user' => 'id', @@ -89,68 +90,68 @@ class WfParseUrlTest extends MediaWikiTestCase { 'path' => '/path', 'query' => 'foo=bar', 'fragment' => 'baz', - ) - ), - array( + ] + ], + [ 'file://example.org/etc/php.ini', - array( + [ 'scheme' => 'file', 'delimiter' => '://', 'host' => 'example.org', 'path' => '/etc/php.ini', - ) - ), - array( + ] + ], + [ 'file:///etc/php.ini', - array( + [ 'scheme' => 'file', 'delimiter' => '://', 'host' => '', 'path' => '/etc/php.ini', - ) - ), - array( + ] + ], + [ 'file:///c:/', - array( + [ 'scheme' => 'file', 'delimiter' => '://', 'host' => '', 'path' => '/c:/', - ) - ), - array( + ] + ], + [ 'mailto:id@example.org', - array( + [ 'scheme' => 'mailto', 'delimiter' => ':', 'host' => 'id@example.org', 'path' => '', - ) - ), - array( + ] + ], + [ 'mailto:id@example.org?subject=Foo', - array( + [ 'scheme' => 'mailto', 'delimiter' => ':', 'host' => 'id@example.org', 'path' => '', 'query' => 'subject=Foo', - ) - ), - array( + ] + ], + [ 'mailto:?subject=Foo', - array( + [ 'scheme' => 'mailto', 'delimiter' => ':', 'host' => '', 'path' => '', 'query' => 'subject=Foo', - ) - ), - array( + ] + ], + [ 'invalid://test/', false - ), - ); + ], + ]; } }