Remove FSRepo
[lhc/web/wiklou.git] / tests / phpunit / includes / ExtraParserTest.php
index 46ec6bc..5dd4f7a 100644 (file)
@@ -16,16 +16,16 @@ class ExtraParserTest extends MediaWikiTestCase {
                parent::setUp();
 
                $contLang = Language::factory( 'en' );
-               $this->setMwGlobals( array(
+               $this->setMwGlobals( [
                        'wgShowDBErrorBacktrace' => true,
-                       'wgLanguageCode' => 'en',
-                       'wgContLang' => $contLang,
-                       'wgLang' => Language::factory( 'en' ),
                        'wgCleanSignatures' => true,
-               ) );
+               ] );
+               $this->setUserLang( 'en' );
+               $this->setContentLang( $contLang );
 
+               // FIXME: This test should pass without setting global content language
                $this->options = ParserOptions::newFromUserAndLang( new User, $contLang );
-               $this->options->setTemplateCallback( array( __CLASS__, 'statelessFetchTemplate' ) );
+               $this->options->setTemplateCallback( [ __CLASS__, 'statelessFetchTemplate' ] );
                $this->parser = new Parser;
 
                MagicWord::clearCache();
@@ -119,11 +119,11 @@ class ExtraParserTest extends MediaWikiTestCase {
        }
 
        public static function provideStringsForCleanSigInSig() {
-               return array(
-                       array( "{{Foo}} ~~~~", "{{Foo}} " ),
-                       array( "~~~", "" ),
-                       array( "~~~~~", "" ),
-               );
+               return [
+                       [ "{{Foo}} ~~~~", "{{Foo}} " ],
+                       [ "~~~", "" ],
+                       [ "~~~~~", "" ],
+               ];
        }
 
        /**
@@ -182,12 +182,12 @@ class ExtraParserTest extends MediaWikiTestCase {
         */
        static function statelessFetchTemplate( $title, $parser = false ) {
                $text = "Content of ''" . $title->getFullText() . "''";
-               $deps = array();
+               $deps = [];
 
-               return array(
+               return [
                        'text' => $text,
                        'finalTitle' => $title,
-                       'deps' => $deps );
+                       'deps' => $deps ];
        }
 
        /**
@@ -198,7 +198,7 @@ class ExtraParserTest extends MediaWikiTestCase {
                $title = Title::newFromText( __FUNCTION__ );
                $catName = wfMessage( 'broken-file-category' )->inContentLanguage()->text();
                $cat = Title::makeTitleSafe( NS_CATEGORY, $catName );
-               $expected = array( $cat->getDBkey() );
+               $expected = [ $cat->getDBkey() ];
                $parserOutput = $this->parser->parse( "[[file:nonexistent]]", $title, $this->options );
                $result = $parserOutput->getCategoryLinks();
                $this->assertEquals( $expected, $result );