X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2FMediaWikiLangTestCase.php;h=fd308b2d9584697045edbf1ae2a46dec617b69c6;hp=53e672247e47e7c8af827803ef20c5d547e4c3b6;hb=08b2cf66387856c623ff99bca4a83db2b7d8c9e6;hpb=1a8daf2c07e31337d83ee39b42873373023c8d40 diff --git a/tests/phpunit/MediaWikiLangTestCase.php b/tests/phpunit/MediaWikiLangTestCase.php index 53e672247e..fd308b2d95 100644 --- a/tests/phpunit/MediaWikiLangTestCase.php +++ b/tests/phpunit/MediaWikiLangTestCase.php @@ -6,7 +6,6 @@ abstract class MediaWikiLangTestCase extends MediaWikiTestCase { protected function setUp() { global $wgLanguageCode, $wgContLang; - parent::setUp(); if ( $wgLanguageCode != $wgContLang->getCode() ) { throw new MWException( "Error in MediaWikiLangTestCase::setUp(): " . @@ -14,18 +13,11 @@ abstract class MediaWikiLangTestCase extends MediaWikiTestCase { "\$wgContLang->getCode() (" . $wgContLang->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(); }