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();
}
public static function provideStringsForCleanSigInSig() {
- return array(
- array( "{{Foo}} ~~~~", "{{Foo}} " ),
- array( "~~~", "" ),
- array( "~~~~~", "" ),
- );
+ return [
+ [ "{{Foo}} ~~~~", "{{Foo}} " ],
+ [ "~~~", "" ],
+ [ "~~~~~", "" ],
+ ];
}
/**
*/
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 ];
}
/**
$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 );