summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes/GlobalFunctions/wfExpandUrlTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/phpunit/includes/GlobalFunctions/wfExpandUrlTest.php')
-rw-r--r--tests/phpunit/includes/GlobalFunctions/wfExpandUrlTest.php20
1 files changed, 9 insertions, 11 deletions
diff --git a/tests/phpunit/includes/GlobalFunctions/wfExpandUrlTest.php b/tests/phpunit/includes/GlobalFunctions/wfExpandUrlTest.php
index c1225e3e..41230a1e 100644
--- a/tests/phpunit/includes/GlobalFunctions/wfExpandUrlTest.php
+++ b/tests/phpunit/includes/GlobalFunctions/wfExpandUrlTest.php
@@ -1,16 +1,17 @@
<?php
/**
- * Tests for wfExpandUrl()
+ * @covers ::wfExpandUrl
*/
class WfExpandUrlTest extends MediaWikiTestCase {
- /** @dataProvider provideExpandableUrls */
+ /**
+ * @dataProvider provideExpandableUrls
+ */
public function testWfExpandUrl( $fullUrl, $shortUrl, $defaultProto, $server, $canServer, $httpsMode, $message ) {
// Fake $wgServer and $wgCanonicalServer
- global $wgServer, $wgCanonicalServer;
- $oldServer = $wgServer;
- $oldCanServer = $wgCanonicalServer;
- $wgServer = $server;
- $wgCanonicalServer = $canServer;
+ $this->setMwGlobals( array(
+ 'wgServer' => $server,
+ 'wgCanonicalServer' => $canServer,
+ ) );
// Fake $_SERVER['HTTPS'] if needed
if ( $httpsMode ) {
@@ -20,10 +21,6 @@ class WfExpandUrlTest extends MediaWikiTestCase {
}
$this->assertEquals( $fullUrl, wfExpandUrl( $shortUrl, $defaultProto ), $message );
-
- // Restore $wgServer and $wgCanonicalServer
- $wgServer = $oldServer;
- $wgCanonicalServer = $oldCanServer;
}
/**
@@ -108,6 +105,7 @@ class WfExpandUrlTest extends MediaWikiTestCase {
}
}
}
+
return $retval;
}
}