From: Platonides Date: Mon, 6 Jun 2011 21:24:23 +0000 (+0000) Subject: Follow up r89585. Clean up after the test, expand inContentLanguage() comment. X-Git-Tag: 1.31.0-rc.0~29650 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=c7137c50a4e9fcd559a4987bdf2062df4ed8a054;p=lhc%2Fweb%2Fwiklou.git Follow up r89585. Clean up after the test, expand inContentLanguage() comment. --- diff --git a/includes/Message.php b/includes/Message.php index 531712fd37..87349ff5fa 100644 --- a/includes/Message.php +++ b/includes/Message.php @@ -224,7 +224,8 @@ class Message { } /** - * Request the message in the wiki's content language. + * Request the message in the wiki's content language, + * unless it is disabled for this message. * @see $wgForceUIMsgAsContentMsg * @return Message: $this */ diff --git a/tests/phpunit/includes/MessageTest.php b/tests/phpunit/includes/MessageTest.php index e1d15dc680..45c02bbe75 100644 --- a/tests/phpunit/includes/MessageTest.php +++ b/tests/phpunit/includes/MessageTest.php @@ -41,11 +41,16 @@ class MessageTest extends MediaWikiLangTestCase { function testInContentLanguage() { global $wgLang, $wgForceUIMsgAsContentMsg; + $oldLang = $wgLang; $wgLang = Language::factory( 'fr' ); - $this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->inContentLanguage()->plain(), "ForceUIMsg disabled" ); - $wgForceUIMsgAsContentMsg[] = 'mainpage'; + $this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->inContentLanguage()->plain(), 'ForceUIMsg disabled' ); + $wgForceUIMsgAsContentMsg['testInContentLanguage'] = 'mainpage'; $this->assertEquals( 'Accueil', wfMessage( 'mainpage' )->inContentLanguage()->plain(), 'ForceUIMsg enabled' ); + + /* Restore globals */ + $wgLang = $oldLang; + unset( $wgForceUIMsgAsContentMsg['testInContentLanguage'] ); } /**