Index: trunk/phase3/maintenance/tests/MessageTest.php |
— | — | @@ -9,32 +9,32 @@ |
10 | 10 | } |
11 | 11 | |
12 | 12 | 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() ); |
19 | 19 | } |
20 | 20 | |
21 | 21 | 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() ); |
26 | 26 | } |
27 | 27 | |
28 | 28 | 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() ); |
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
36 | 36 | * @expectedException MWException |
37 | 37 | */ |
38 | 38 | function testInLanguageThrows() { |
39 | | - Message::key( 'foo' )->inLanguage( 123 ); |
| 39 | + wfMessage( 'foo' )->inLanguage( 123 ); |
40 | 40 | } |
41 | 41 | } |