Merge "Parser: Hard deprecate getConverterLanguage" into REL1_34
[lhc/web/wiklou.git] / tests / phpunit / includes / parser / MagicVariableTest.php
index 9f5e386..cc474dd 100644 (file)
@@ -9,12 +9,13 @@
  * @author Antoine Musso
  * @copyright Copyright © 2011, Antoine Musso
  * @file
- *
- * @group Database
  */
 
+use Wikimedia\TestingAccessWrapper;
+
 /**
- * @covers Parser::getVariableValue
+ * @group Database
+ * @covers Parser::expandMagicVariable
  */
 class MagicVariableTest extends MediaWikiTestCase {
        /**
@@ -39,10 +40,7 @@ class MagicVariableTest extends MediaWikiTestCase {
                parent::setUp();
 
                $contLang = Language::factory( 'en' );
-               $this->setMwGlobals( [
-                       'wgLanguageCode' => 'en',
-                       'wgContLang' => $contLang,
-               ] );
+               $this->setContentLang( $contLang );
 
                $this->testParser = new Parser();
                $this->testParser->Options( ParserOptions::newFromUserAndLang( new User, $contLang ) );
@@ -226,7 +224,7 @@ class MagicVariableTest extends MediaWikiTestCase {
 
                $this->assertSame(
                        $expected,
-                       $this->testParser->getVariableValue( $magic ),
+                       TestingAccessWrapper::newFromObject( $this->testParser )->expandMagicVariable( $magic ),
                        $msg
                );
        }