Index: trunk/phase3/maintenance/tests/MessageTest.php |
— | — | @@ -16,4 +16,18 @@ |
17 | 17 | $this->assertEquals( 'Main Page', Message::key( 'mainpage' )->text() ); |
18 | 18 | $this->assertEquals( '<i-dont-exist-evar>', Message::key( 'i-dont-exist-evar' )->text() ); |
19 | 19 | } |
| 20 | + |
| 21 | + function testInLanguage() { |
| 22 | + $this->assertEquals( 'Main Page', Message::key( 'mainpage' )->inLanguage( 'en' )->text() ); |
| 23 | + $this->assertEquals( 'Заглавная страница', Message::key( 'mainpage' )->inLanguage( 'ru' )->text() ); |
| 24 | + $this->assertEquals( 'Main Page', Message::key( 'mainpage' )->inLanguage( Language::factory( 'en' ) )->text() ); |
| 25 | + $this->assertEquals( 'Заглавная страница', Message::key( 'mainpage' )->inLanguage( Language::factory( 'ru' ) )->text() ); |
| 26 | + } |
| 27 | + |
| 28 | + /** |
| 29 | + * @expectedException |
| 30 | + */ |
| 31 | + function testInLanguageThrows() { |
| 32 | + Message::key( 'foo' )->inLanguage( 123 ); |
| 33 | + } |
20 | 34 | } |
\ No newline at end of file |