Index: trunk/phase3/tests/phpunit/includes/MessageTest.php |
— | — | @@ -41,11 +41,16 @@ |
42 | 42 | |
43 | 43 | function testInContentLanguage() { |
44 | 44 | global $wgLang, $wgForceUIMsgAsContentMsg; |
| 45 | + $oldLang = $wgLang; |
45 | 46 | $wgLang = Language::factory( 'fr' ); |
46 | 47 | |
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'; |
49 | 50 | $this->assertEquals( 'Accueil', wfMessage( 'mainpage' )->inContentLanguage()->plain(), 'ForceUIMsg enabled' ); |
| 51 | + |
| 52 | + /* Restore globals */ |
| 53 | + $wgLang = $oldLang; |
| 54 | + unset( $wgForceUIMsgAsContentMsg['testInContentLanguage'] ); |
50 | 55 | } |
51 | 56 | |
52 | 57 | /** |
Index: trunk/phase3/includes/Message.php |
— | — | @@ -224,7 +224,8 @@ |
225 | 225 | } |
226 | 226 | |
227 | 227 | /** |
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. |
229 | 230 | * @see $wgForceUIMsgAsContentMsg |
230 | 231 | * @return Message: $this |
231 | 232 | */ |