jenkins-bot has submitted this change and it was merged.

Change subject: Fix magic getter for $status->ok
......................................................................


Fix magic getter for $status->ok

__get called a non-existant function which caused errors
in file deletion.

Also adds tests for $status->ok and $status->errors

Change-Id: I8f5a21eb8d795e5e3f5a58f2384ad0dcbad749a2
(cherry picked from commit 7a8440210874d265a73468607647eb9910ba80a5)
---
M includes/Status.php
M tests/phpunit/includes/StatusTest.php
2 files changed, 12 insertions(+), 1 deletion(-)

Approvals:
  MarkTraceur: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Status.php b/includes/Status.php
index 61a0047..cd10258 100644
--- a/includes/Status.php
+++ b/includes/Status.php
@@ -437,7 +437,7 @@
         */
        function __get( $name ) {
                if ( $name === 'ok' ) {
-                       return $this->sv->getOK();
+                       return $this->sv->isOK();
                } elseif ( $name === 'errors' ) {
                        return $this->sv->getErrors();
                }
diff --git a/tests/phpunit/includes/StatusTest.php 
b/tests/phpunit/includes/StatusTest.php
index 44463cf..c013f4f 100644
--- a/tests/phpunit/includes/StatusTest.php
+++ b/tests/phpunit/includes/StatusTest.php
@@ -57,6 +57,17 @@
        }
 
        /**
+        *
+        */
+       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
         */

-- 
To view, visit https://gerrit.wikimedia.org/r/191053
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8f5a21eb8d795e5e3f5a58f2384ad0dcbad749a2
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.25wmf17
Gerrit-Owner: MarkTraceur <mtrac...@member.fsf.org>
Gerrit-Reviewer: MarkTraceur <mtrac...@member.fsf.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to