Brought to you by vim macros. Bug: T200246 Change-Id: I79e919f4553e3bd3eb714073fed7a43051b4fb2a
27 lines
713 B
PHP
27 lines
713 B
PHP
<?php
|
|
|
|
use MediaWiki\MediaWikiServices;
|
|
|
|
/**
|
|
* Base class that store and restore the Language objects
|
|
*/
|
|
abstract class MediaWikiLangTestCase extends MediaWikiTestCase {
|
|
protected function setUp() {
|
|
global $wgLanguageCode;
|
|
|
|
$contLang = MediaWikiServices::getInstance()->getContentLanguage();
|
|
if ( $wgLanguageCode != $contLang->getCode() ) {
|
|
throw new MWException( "Error in MediaWikiLangTestCase::setUp(): " .
|
|
"\$wgLanguageCode ('$wgLanguageCode') is different from content language code (" .
|
|
$contLang->getCode() . ")" );
|
|
}
|
|
|
|
parent::setUp();
|
|
|
|
$this->setUserLang( 'en' );
|
|
// For mainpage to be 'Main Page'
|
|
$this->setContentLang( 'en' );
|
|
|
|
MessageCache::singleton()->disable();
|
|
}
|
|
}
|