From: Chad Horohoe Date: Wed, 13 Jul 2011 01:54:40 +0000 (+0000) Subject: Add some tests for wfExpandUrl. Definitely not complete (needs some for protocol... X-Git-Tag: 1.31.0-rc.0~28882 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=4faa55d958509cb298726d1b884beea767886275;p=lhc%2Fweb%2Fwiklou.git Add some tests for wfExpandUrl. Definitely not complete (needs some for protocol relativeness) --- diff --git a/tests/phpunit/includes/GlobalFunctions/wfExpandUrl.php b/tests/phpunit/includes/GlobalFunctions/wfExpandUrl.php new file mode 100644 index 0000000000..a59fcc032d --- /dev/null +++ b/tests/phpunit/includes/GlobalFunctions/wfExpandUrl.php @@ -0,0 +1,26 @@ +assertEquals( $fullUrl, wfExpandUrl( $shortUrl ), $message ); + } + + /** + * Provider of URL examples for testing wfExpandUrl() + */ + public function provideExpandableUrls() { + global $wgServer; + return array( + array( "$wgServer/wiki/FooBar", '/wiki/FooBar', 'Testing expanding URL beginning with /' ), + array( 'http://example.com', 'http://example.com', 'Testing fully qualified http URLs (no need to expand)' ), + array( 'https://example.com', 'https://example.com', 'Testing fully qualified https URLs (no need to expand)' ), + # Would be nice to support this, see fixme on wfExpandUrl() + array( "wiki/FooBar", 'wiki/FooBar', "Test non-expandable relative URLs" ), + ); + } +}