MediaWiki REL1_32
MediaWikiLangTestCase.php
Go to the documentation of this file.
1<?php
2
4
9 protected function setUp() {
10 global $wgLanguageCode;
11
12 $contLang = MediaWikiServices::getInstance()->getContentLanguage();
13 if ( $wgLanguageCode != $contLang->getCode() ) {
14 throw new MWException( "Error in MediaWikiLangTestCase::setUp(): " .
15 "\$wgLanguageCode ('$wgLanguageCode') is different from content language code (" .
16 $contLang->getCode() . ")" );
17 }
18
19 parent::setUp();
20
21 $this->setUserLang( 'en' );
22 // For mainpage to be 'Main Page'
23 $this->setContentLang( 'en' );
24
25 MessageCache::singleton()->disable();
26 }
27}
$wgLanguageCode
Site language code.
MediaWiki exception.
Base class that store and restore the Language objects.
MediaWikiServices is the service locator for the application scope of MediaWiki.