summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes/StatusTest.php
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-05-01 15:30:02 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-05-01 15:30:02 -0400
commit1de335ad3f395ca6861085393ba366a9e3fb4a0d (patch)
treef1fdd326034e05177596851be6a7127615d81498 /tests/phpunit/includes/StatusTest.php
parent9c75fa8ff6d4d38ef552c00fef5969fb154765e8 (diff)
parentf6d65e533c62f6deb21342d4901ece24497b433e (diff)
Merge commit 'f6d65'
# Conflicts: # skins/ArchLinux/ArchLinux.php
Diffstat (limited to 'tests/phpunit/includes/StatusTest.php')
-rw-r--r--tests/phpunit/includes/StatusTest.php15
1 files changed, 14 insertions, 1 deletions
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
@@ -57,6 +57,17 @@ class StatusTest extends MediaWikiLangTestCase {
}
/**
+ *
+ */
+ 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() );
}