X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fphpunit%2FMediaWikiLangTestCase.php;h=fd308b2d9584697045edbf1ae2a46dec617b69c6;hb=5b351e86eaa744e112def01dda9ecb0e48aed931;hp=1131385f6b944f745af792d28b8378a675b27206;hpb=59404fb12ee50a52925709a389f9c263f3e332a2;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/MediaWikiLangTestCase.php b/tests/phpunit/MediaWikiLangTestCase.php index 1131385f6b..fd308b2d95 100644 --- a/tests/phpunit/MediaWikiLangTestCase.php +++ b/tests/phpunit/MediaWikiLangTestCase.php @@ -4,10 +4,8 @@ * Base class that store and restore the Language objects */ abstract class MediaWikiLangTestCase extends MediaWikiTestCase { - protected function setUp() { global $wgLanguageCode, $wgContLang; - parent::setUp(); if ( $wgLanguageCode != $wgContLang->getCode() ) { throw new MWException( "Error in MediaWikiLangTestCase::setUp(): " . @@ -15,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(); }