aboutsummaryrefslogtreecommitdiffstats
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.php13
1 files changed, 4 insertions, 9 deletions
diff --git a/tests/phpunit/includes/GlobalFunctions/wfExpandUrlTest.php b/tests/phpunit/includes/GlobalFunctions/wfExpandUrlTest.php
index c1225e3e06ee..8c67ced40266 100644
--- a/tests/phpunit/includes/GlobalFunctions/wfExpandUrlTest.php
+++ b/tests/phpunit/includes/GlobalFunctions/wfExpandUrlTest.php
@@ -6,11 +6,10 @@ class WfExpandUrlTest extends MediaWikiTestCase {
/** @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 +19,6 @@ class WfExpandUrlTest extends MediaWikiTestCase {
}
$this->assertEquals( $fullUrl, wfExpandUrl( $shortUrl, $defaultProto ), $message );
-
- // Restore $wgServer and $wgCanonicalServer
- $wgServer = $oldServer;
- $wgCanonicalServer = $oldCanServer;
}
/**