r72284 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72283‎ | r72284 | r72285 >
Date:14:00, 3 September 2010
Author:platonides
Status:deferred
Tags:
Comment:
Follow up r72202 rename of Message::key() to wfMessage()
Modified paths:
  • /trunk/phase3/maintenance/tests/MessageTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/tests/MessageTest.php
@@ -9,32 +9,32 @@
1010 }
1111
1212 function testExists() {
13 - $this->assertTrue( Message::key( 'mainpage' )->exists() );
14 - $this->assertTrue( Message::key( 'mainpage' )->params( array() )->exists() );
15 - $this->assertTrue( Message::key( 'mainpage' )->rawParams( 'foo', 123 )->exists() );
16 - $this->assertFalse( Message::key( 'i-dont-exist-evar' )->exists() );
17 - $this->assertFalse( Message::key( 'i-dont-exist-evar' )->params( array() )->exists() );
18 - $this->assertFalse( Message::key( 'i-dont-exist-evar' )->rawParams( 'foo', 123 )->exists() );
 13+ $this->assertTrue( wfMessage( 'mainpage' )->exists() );
 14+ $this->assertTrue( wfMessage( 'mainpage' )->params( array() )->exists() );
 15+ $this->assertTrue( wfMessage( 'mainpage' )->rawParams( 'foo', 123 )->exists() );
 16+ $this->assertFalse( wfMessage( 'i-dont-exist-evar' )->exists() );
 17+ $this->assertFalse( wfMessage( 'i-dont-exist-evar' )->params( array() )->exists() );
 18+ $this->assertFalse( wfMessage( 'i-dont-exist-evar' )->rawParams( 'foo', 123 )->exists() );
1919 }
2020
2121 function testKey() {
22 - $this->assertType( 'Message', Message::key( 'mainpage' ) );
23 - $this->assertType( 'Message', Message::key( 'i-dont-exist-evar' ) );
24 - $this->assertEquals( 'Main Page', Message::key( 'mainpage' )->text() );
25 - $this->assertEquals( '<i-dont-exist-evar>', Message::key( 'i-dont-exist-evar' )->text() );
 22+ $this->assertType( 'Message', wfMessage( 'mainpage' ) );
 23+ $this->assertType( 'Message', wfMessage( 'i-dont-exist-evar' ) );
 24+ $this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->text() );
 25+ $this->assertEquals( '<i-dont-exist-evar>', wfMessage( 'i-dont-exist-evar' )->text() );
2626 }
2727
2828 function testInLanguage() {
29 - $this->assertEquals( 'Main Page', Message::key( 'mainpage' )->inLanguage( 'en' )->text() );
30 - $this->assertEquals( 'Заглавная страница', Message::key( 'mainpage' )->inLanguage( 'ru' )->text() );
31 - $this->assertEquals( 'Main Page', Message::key( 'mainpage' )->inLanguage( Language::factory( 'en' ) )->text() );
32 - $this->assertEquals( 'Заглавная страница', Message::key( 'mainpage' )->inLanguage( Language::factory( 'ru' ) )->text() );
 29+ $this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->inLanguage( 'en' )->text() );
 30+ $this->assertEquals( 'Заглавная страница', wfMessage( 'mainpage' )->inLanguage( 'ru' )->text() );
 31+ $this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->inLanguage( Language::factory( 'en' ) )->text() );
 32+ $this->assertEquals( 'Заглавная страница', wfMessage( 'mainpage' )->inLanguage( Language::factory( 'ru' ) )->text() );
3333 }
3434
3535 /**
3636 * @expectedException MWException
3737 */
3838 function testInLanguageThrows() {
39 - Message::key( 'foo' )->inLanguage( 123 );
 39+ wfMessage( 'foo' )->inLanguage( 123 );
4040 }
4141 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r72202One step forward with the Message class....nikerabbit17:12, 2 September 2010

Status & tagging log