* 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(): " .
+ throw new MWException( "Error in MediaWikiLangTestCase::setUp(): " .
"\$wgLanguageCode ('$wgLanguageCode') is different from " .
"\$wgContLang->getCode() (" . $wgContLang->getCode() . ")" );
}
- $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();
}