wiki.techinc.nl/tests/phpunit/MediaWikiLangTestCase.php
Platonides 10cd6f1b6a Fix the old XmlTest.php test bug in the dateMenu() when the wiki is configured for a languange other than English
Other tests were running before and messing with the Language objects.
2011-05-01 19:32:49 +00:00

32 lines
765 B
PHP

<?php
/**
* Base class that store and restore the Language objects
*/
class MediaWikiLangTestCase extends MediaWikiTestCase {
private static $oldLang;
private static $oldContLang;
public function setUp() {
global $wgLanguageCode, $wgLang, $wgContLang;
self::$oldLang = $wgLang;
self::$oldContLang = $wgContLang;
if( $wgLanguageCode != $wgContLang->getCode() ) die("nooo!");
$wgLanguageCode = 'en'; # For mainpage to be 'Main Page'
$wgContLang = $wgLang = Language::factory( $wgLanguageCode );
MessageCache::singleton()->disable();
}
public function tearDown() {
global $wgContLang, $wgLang, $wgLanguageCode;
$wgLang = self::$oldLang;
$wgContLang = self::$oldContLang;
$wgLanguageCode = $wgContLang->getCode();
}
}