Allow Status::hasMessage to work with Message objects.
[lhc/web/wiklou.git] / tests / phpunit / includes / StatusTest.php
index b0e6d20..8281073 100644 (file)
@@ -259,7 +259,10 @@ class StatusTest extends MediaWikiLangTestCase {
        public function testHasMessage() {
                $status = new Status();
                $status->fatal( 'bad' );
+               $status->fatal( wfMessage( 'bad-msg' ) );
                $this->assertTrue( $status->hasMessage( 'bad' ) );
+               $this->assertTrue( $status->hasMessage( 'bad-msg' ) );
+               $this->assertTrue( $status->hasMessage( wfMessage( 'bad-msg' ) ) );
                $this->assertFalse( $status->hasMessage( 'good' ) );
        }
 
@@ -541,7 +544,7 @@ class StatusTest extends MediaWikiLangTestCase {
         */
        public function testGetStatusArrayWithNonObjectMessages( $nonObjMsg ) {
                $status = new Status();
-               if( !array_key_exists( 1, $nonObjMsg ) ) {
+               if ( !array_key_exists( 1, $nonObjMsg ) ) {
                        $status->warning( $nonObjMsg[0] );
                } else {
                        $status->warning( $nonObjMsg[0], $nonObjMsg[1] );