r89612 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89611‎ | r89612 | r89613 >
Date:21:24, 6 June 2011
Author:platonides
Status:ok
Tags:
Comment:
Follow up r89585. Clean up after the test, expand inContentLanguage() comment.
Modified paths:
  • /trunk/phase3/includes/Message.php (modified) (history)
  • /trunk/phase3/tests/phpunit/includes/MessageTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/MessageTest.php
@@ -41,11 +41,16 @@
4242
4343 function testInContentLanguage() {
4444 global $wgLang, $wgForceUIMsgAsContentMsg;
 45+ $oldLang = $wgLang;
4546 $wgLang = Language::factory( 'fr' );
4647
47 - $this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->inContentLanguage()->plain(), "ForceUIMsg disabled" );
48 - $wgForceUIMsgAsContentMsg[] = 'mainpage';
 48+ $this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->inContentLanguage()->plain(), 'ForceUIMsg disabled' );
 49+ $wgForceUIMsgAsContentMsg['testInContentLanguage'] = 'mainpage';
4950 $this->assertEquals( 'Accueil', wfMessage( 'mainpage' )->inContentLanguage()->plain(), 'ForceUIMsg enabled' );
 51+
 52+ /* Restore globals */
 53+ $wgLang = $oldLang;
 54+ unset( $wgForceUIMsgAsContentMsg['testInContentLanguage'] );
5055 }
5156
5257 /**
Index: trunk/phase3/includes/Message.php
@@ -224,7 +224,8 @@
225225 }
226226
227227 /**
228 - * Request the message in the wiki's content language.
 228+ * Request the message in the wiki's content language,
 229+ * unless it is disabled for this message.
229230 * @see $wgForceUIMsgAsContentMsg
230231 * @return Message: $this
231232 */

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r89585Fix for bug 29274 - Message class ignores $wgForceUIMsgAsContentMsg...nikerabbit17:55, 6 June 2011

Status & tagging log