From f6d65e533c62f6deb21342d4901ece24497b433e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 4 Jun 2015 07:31:04 +0200 Subject: Update to MediaWiki 1.25.1 --- tests/phpunit/includes/StatusTest.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'tests/phpunit/includes/StatusTest.php') diff --git a/tests/phpunit/includes/StatusTest.php b/tests/phpunit/includes/StatusTest.php index 628c59b6..c013f4fc 100644 --- a/tests/phpunit/includes/StatusTest.php +++ b/tests/phpunit/includes/StatusTest.php @@ -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 @@ -109,7 +120,9 @@ class StatusTest extends MediaWikiLangTestCase { public function testIsGood( $ok, $errors, $expected ) { $status = new Status(); $status->ok = $ok; - $status->errors = $errors; + foreach ( $errors as $error ) { + $status->warning( $error ); + } $this->assertEquals( $expected, $status->isGood() ); } -- cgit v1.2.3-54-g00ecf