From: Platonides Date: Sun, 1 May 2011 19:32:49 +0000 (+0000) Subject: Fix the old XmlTest.php test bug in the dateMenu() when the wiki is configured for... X-Git-Tag: 1.31.0-rc.0~30478 X-Git-Url: http://git.cyclocoop.org/data/Fool?a=commitdiff_plain;h=10cd6f1b6ad05b21067d52f998da47fb927ded69;p=lhc%2Fweb%2Fwiklou.git 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. --- diff --git a/tests/phpunit/MediaWikiLangTestCase.php b/tests/phpunit/MediaWikiLangTestCase.php new file mode 100644 index 0000000000..9c514bbede --- /dev/null +++ b/tests/phpunit/MediaWikiLangTestCase.php @@ -0,0 +1,32 @@ +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(); + } + +} diff --git a/tests/phpunit/includes/LanguageConverterTest.php b/tests/phpunit/includes/LanguageConverterTest.php index d26db94f88..d084540c9c 100644 --- a/tests/phpunit/includes/LanguageConverterTest.php +++ b/tests/phpunit/includes/LanguageConverterTest.php @@ -1,10 +1,12 @@ disable(); - } +class MessageTest extends MediaWikiLangTestCase { function testExists() { $this->assertTrue( wfMessage( 'mainpage' )->exists() ); diff --git a/tests/phpunit/includes/SampleTest.php b/tests/phpunit/includes/SampleTest.php index fa7c4d5b91..fc7881aa27 100644 --- a/tests/phpunit/includes/SampleTest.php +++ b/tests/phpunit/includes/SampleTest.php @@ -1,6 +1,6 @@ getCode(); + } public function testExpandAttributes() { $this->assertNull( Xml::expandAttributes(null),