X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2FMediaWikiLangTestCase.php;h=4b0edb13f18d4f36afe3bbab10b8f1b0dc633c86;hb=2eef43c257123e8eea083a4c823dfcbdeca3ac57;hp=1131385f6b944f745af792d28b8378a675b27206;hpb=331bcf6ac9a5df389a0196ee71418d7620d34278;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/MediaWikiLangTestCase.php b/tests/phpunit/MediaWikiLangTestCase.php index 1131385f6b..4b0edb13f1 100644 --- a/tests/phpunit/MediaWikiLangTestCase.php +++ b/tests/phpunit/MediaWikiLangTestCase.php @@ -1,32 +1,26 @@ getCode() ) { + $contLang = MediaWikiServices::getInstance()->getContentLanguage(); + if ( $wgLanguageCode != $contLang->getCode() ) { throw new MWException( "Error in MediaWikiLangTestCase::setUp(): " . - "\$wgLanguageCode ('$wgLanguageCode') is different from " . - "\$wgContLang->getCode() (" . $wgContLang->getCode() . ")" ); + "\$wgLanguageCode ('$wgLanguageCode') is different from content language code (" . + $contLang->getCode() . ")" ); } - // HACK: Call getLanguage() so the real $wgContLang is cached as the user language - // rather than our fake one. This is to avoid breaking other, unrelated tests. - RequestContext::getMain()->getLanguage(); - - $langCode = 'en'; # For mainpage to be 'Main Page' - $langObj = Language::factory( $langCode ); + parent::setUp(); - $this->setMwGlobals( array( - 'wgLanguageCode' => $langCode, - 'wgLang' => $langObj, - 'wgContLang' => $langObj, - ) ); + $this->setUserLang( 'en' ); + // For mainpage to be 'Main Page' + $this->setContentLang( 'en' ); MessageCache::singleton()->disable(); }