Page MenuHomeWickedGov Phorge

MediaWikiLangTestCase.php
No OneTemporary

Size
894 B
Referenced Files
None
Subscribers
None

MediaWikiLangTestCase.php

<?php
use MediaWiki\MainConfigNames;
/**
* Base class that store and restore the Language objects
*/
abstract class MediaWikiLangTestCase extends MediaWikiIntegrationTestCase {
/**
* The annotation causes this to be called immediately before setUp()
* @before
*/
final protected function mediaWikiLangSetUp(): void {
$services = $this->getServiceContainer();
$languageCode = $this->getConfVar( MainConfigNames::LanguageCode );
$contLanguageCode = $services->getContentLanguageCode()->toString();
if ( $languageCode !== $contLanguageCode ) {
throw new RuntimeException( "Error in " . __METHOD__ . ': ' .
"\$wgLanguageCode ('$languageCode') is different from content language code " .
"('$contLanguageCode')" );
}
$this->setUserLang( 'en' );
// For mainpage to be 'Main Page'
$this->setContentLang( 'en' );
$services->getMessageCache()->disable();
}
}

File Metadata

Mime Type
text/x-php
Expires
Wed, Aug 19, 12:21 (3 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ff/52/37f163e3614b69a62d0955d79804
Default Alt Text
MediaWikiLangTestCase.php (894 B)

Event Timeline