Use setMwGlobals in TitleTest::testGetPageViewLanguage
authorumherirrender <umherirrender_de.wp@web.de>
Thu, 16 Oct 2014 17:44:39 +0000 (19:44 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Thu, 16 Oct 2014 17:44:39 +0000 (19:44 +0200)
Change-Id: I42cb31bf7c1fa1b77f2e8465e7e1e316972fec09

tests/phpunit/includes/TitleTest.php

index fb58381..a4bc427 100644 (file)
@@ -428,14 +428,14 @@ class TitleTest extends MediaWikiTestCase {
        public function testGetPageViewLanguage( $expected, $titleText, $contLang,
                $lang, $variant, $msg = ''
        ) {
-               global $wgLanguageCode, $wgContLang, $wgLang, $wgDefaultLanguageVariant, $wgAllowUserJs;
-
                // Setup environnement for this test
-               $wgLanguageCode = $contLang;
-               $wgContLang = Language::factory( $contLang );
-               $wgLang = Language::factory( $lang );
-               $wgDefaultLanguageVariant = $variant;
-               $wgAllowUserJs = true;
+               $this->setMwGlobals( array(
+                       'wgLanguageCode' => $contLang,
+                       'wgContLang' => Language::factory( $contLang ),
+                       'wgLang' => Language::factory( $lang ),
+                       'wgDefaultLanguageVariant' => $variant,
+                       'wgAllowUserJs' => true,
+               ) );
 
                $title = Title::newFromText( $titleText );
                $this->assertInstanceOf( 'Title', $title,