$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
);
$status = new Status();
- $status->warning( new Message( 'fooBar!', array( 'foo', 'bar' ) ) );
+ $status->warning( new Message( 'fooBar!', array( 'foo', 'bar' ) ) );
$testCases['1MessageWarning'] = array(
$status,
"<fooBar!>",
// and the first call to the setUp method. Because of that you can't access any variables
// you create there from within a data provider."
// http://phpunit.de/manual/3.7/en/writing-tests-for-phpunit.html
-// $status = new Status();
-// $status->warning( 'fooBar!' );
-// $status->warning( 'fooBar2!' );
-// $testCases[ '2StringWarnings' ] = array(
-// $status,
-// array( new Message( 'fooBar!' ), new Message( 'fooBar2!' ) ),
-// "* \$1\n* \$2"
-// );
+// $status = new Status();
+// $status->warning( 'fooBar!' );
+// $status->warning( 'fooBar2!' );
+// $testCases[ '2StringWarnings' ] = array(
+// $status,
+// array( new Message( 'fooBar!' ), new Message( 'fooBar2!' ) ),
+// "* \$1\n* \$2"
+// );
$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' ),