Index: trunk/phase3/maintenance/tests/MessageTest.php |
— | — | @@ -0,0 +1,19 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +class MessageTest extends PHPUnit_Framework_TestCase { |
| 5 | + function testExists() { |
| 6 | + $this->assertTrue( Message::key( 'mainpage' )->exists() ); |
| 7 | + $this->assertTrue( Message::key( 'mainpage' )->params( array() )->exists() ); |
| 8 | + $this->assertTrue( Message::key( 'mainpage' )->rawParams( 'foo', 123 )->exists() ); |
| 9 | + $this->assertFalse( Message::key( 'i-dont-exist-evar' )->exists() ); |
| 10 | + $this->assertFalse( Message::key( 'i-dont-exist-evar' )->params( array() )->exists() ); |
| 11 | + $this->assertFalse( Message::key( 'i-dont-exist-evar' )->rawParams( 'foo', 123 )->exists() ); |
| 12 | + } |
| 13 | + |
| 14 | + function testKey() { |
| 15 | + $this->assertType( 'Message', Message::key( 'mainpage' ) ); |
| 16 | + $this->assertType( 'Message', Message::key( 'i-dont-exist-evar' ) ); |
| 17 | + $this->assertEquals( 'Main Page', Message::key( 'mainpage' )->text() ); |
| 18 | + $this->assertEquals( '<i-dont-exist-evar>', Message::key( 'i-dont-exist-evar' )->text() ); |
| 19 | + } |
| 20 | +} |
\ No newline at end of file |
Property changes on: trunk/phase3/maintenance/tests/MessageTest.php |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 21 | + native |
Index: trunk/phase3/includes/Message.php |
— | — | @@ -277,7 +277,7 @@ |
278 | 278 | * @return Bool: true if it is and false if not. |
279 | 279 | */ |
280 | 280 | public function exists() { |
281 | | - return $this->fetchMessage() === false; |
| 281 | + return $this->fetchMessage() !== false; |
282 | 282 | } |
283 | 283 | |
284 | 284 | public static function rawParam( $value ) { |