Bug: T192167 Depends-On: I581e54278ac5da3f4e399e33f2c7ad468bae6b43 Change-Id: I3a21fb55db76bac51afdd399cf40ed0760e4f343
27 lines
720 B
PHP
27 lines
720 B
PHP
<?php
|
|
|
|
use MediaWiki\MediaWikiServices;
|
|
|
|
/**
|
|
* Base class that store and restore the Language objects
|
|
*/
|
|
abstract class MediaWikiLangTestCase extends MediaWikiTestCase {
|
|
protected function setUp() : void {
|
|
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();
|
|
}
|
|
}
|