MediaWiki  REL1_21
MediaWikiLangTestCase.php
Go to the documentation of this file.
00001 <?php
00002 
00006 abstract class MediaWikiLangTestCase extends MediaWikiTestCase {
00007 
00008         protected function setUp() {
00009                 global $wgLanguageCode, $wgContLang;
00010                 parent::setUp();
00011 
00012                 if ( $wgLanguageCode != $wgContLang->getCode() ) {
00013                         throw new MWException( "Error in MediaWikiLangTestCase::setUp(): " .
00014                                 "\$wgLanguageCode ('$wgLanguageCode') is different from " .
00015                                 "\$wgContLang->getCode() (" . $wgContLang->getCode() . ")" );
00016                 }
00017 
00018                 $langCode = 'en'; # For mainpage to be 'Main Page'
00019                 $langObj = Language::factory( $langCode );
00020 
00021                 $this->setMwGlobals( array(
00022                         'wgLanguageCode' => $langCode,
00023                         'wgLang' => $langObj,
00024                         'wgContLang' => $langObj,
00025                 ) );
00026 
00027                 MessageCache::singleton()->disable();
00028         }
00029 }