X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2FMediaWikiLangTestCase.php;h=53e672247e47e7c8af827803ef20c5d547e4c3b6;hb=b7c79a9dc0fd5b38de7030fdc3a1a1befda799d4;hp=0cf6e383e5c360aa103a194a02fba39b18053885;hpb=44ec76cdfeb4e1fd6d436844b3276cc44bc37892;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/MediaWikiLangTestCase.php b/tests/phpunit/MediaWikiLangTestCase.php index 0cf6e383e5..53e672247e 100644 --- a/tests/phpunit/MediaWikiLangTestCase.php +++ b/tests/phpunit/MediaWikiLangTestCase.php @@ -4,7 +4,6 @@ * Base class that store and restore the Language objects */ abstract class MediaWikiLangTestCase extends MediaWikiTestCase { - protected function setUp() { global $wgLanguageCode, $wgContLang; parent::setUp(); @@ -15,6 +14,10 @@ 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 );