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

Change subject: Add test for Status->merge with overrideValue true
......................................................................


Add test for Status->merge with overrideValue true

Change-Id: I049c67e80277f8dbbbadae6e7a8f30d66066e7bf
---
M tests/phpunit/includes/StatusTest.php
1 file changed, 17 insertions(+), 1 deletion(-)

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



diff --git a/tests/phpunit/includes/StatusTest.php 
b/tests/phpunit/includes/StatusTest.php
index a3d68b6..aa5367e 100644
--- a/tests/phpunit/includes/StatusTest.php
+++ b/tests/phpunit/includes/StatusTest.php
@@ -200,7 +200,6 @@
 
        /**
         * @covers Status::merge
-        * @todo test merge with $overwriteValue true
         */
        public function testMerge() {
                $status1 = new Status();
@@ -215,6 +214,23 @@
        }
 
        /**
+        * @covers Status::merge
+        */
+       public function testMergeWithOverwriteValue() {
+               $status1 = new Status();
+               $status2 = new Status();
+               $message1 = $this->getMockMessage( 'warn1' );
+               $message2 = $this->getMockMessage( 'error2' );
+               $status1->warning( $message1 );
+               $status2->error( $message2 );
+               $status2->value = 'FooValue';
+
+               $status1->merge( $status2, true );
+               $this->assertEquals( 2, count( $status1->getWarningsArray() ) + 
count( $status1->getErrorsArray() ) );
+               $this->assertEquals( 'FooValue', $status1->getValue() );
+       }
+
+       /**
         * @covers Status::hasMessage
         */
        public function testHasMessage() {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I049c67e80277f8dbbbadae6e7a8f30d66066e7bf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Addshore <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Mwalker <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to