Merge "Switched upload chunk status store to the main object stash"
[lhc/web/wiklou.git] / tests / phpunit / includes / StatusTest.php
index 44463cf..291ed31 100644 (file)
@@ -56,6 +56,17 @@ class StatusTest extends MediaWikiLangTestCase {
                $this->assertEquals( $message, $status->getMessage()->getKey() );
        }
 
+       /**
+        *
+        */
+       public function testOkAndErrors() {
+               $status = Status::newGood( 'foo' );
+               $this->assertTrue( $status->ok );
+               $status = Status::newFatal( 'foo', 1, 2 );
+               $this->assertFalse( $status->ok );
+               $this->assertArrayEquals( array( array( 'type' => 'error', 'message' => 'foo', 'params' => array( 1, 2 ) ) ), $status->errors );
+       }
+
        /**
         * @dataProvider provideSetResult
         * @covers Status::setResult
@@ -361,7 +372,7 @@ class StatusTest extends MediaWikiLangTestCase {
                );
 
                $status = new Status();
-               $status->warning( new Message( 'fooBar!', array( 'foo', 'bar' )  ) );
+               $status->warning( new Message( 'fooBar!', array( 'foo', 'bar' ) ) );
                $testCases['1MessageWarning'] = array(
                        $status,
                        "<fooBar!>",
@@ -438,7 +449,7 @@ class StatusTest extends MediaWikiLangTestCase {
 //             );
 
                $status = new Status();
-               $status->warning( new Message( 'fooBar!', array( 'foo', 'bar' )  ) );
+               $status->warning( new Message( 'fooBar!', array( 'foo', 'bar' ) ) );
                $testCases['1MessageWarning'] = array(
                        $status,
                        array( 'foo', 'bar' ),