From c7137c50a4e9fcd559a4987bdf2062df4ed8a054 Mon Sep 17 00:00:00 2001 From: Platonides Date: Mon, 6 Jun 2011 21:24:23 +0000 Subject: [PATCH] Follow up r89585. Clean up after the test, expand inContentLanguage() comment. --- includes/Message.php | 3 ++- tests/phpunit/includes/MessageTest.php | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) 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'] ); } /** -- 2.20.1