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

Change subject: Override phpunit assertTag method to stop errors
......................................................................


Override phpunit assertTag method to stop errors

This method throws a deperecation error in phpunit
that we dont want to see (and dont want to break
travis tests).

Nothing this method uses is beign deprecated thus
we can override the method and not need to worry
about the error or it vanishing in the future!

Bug: 69505
Change-Id: I0eb63be390b4fdf416635dd8e8a2ad94615e6a47
---
M tests/phpunit/MediaWikiTestCase.php
1 file changed, 20 insertions(+), 0 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/phpunit/MediaWikiTestCase.php 
b/tests/phpunit/MediaWikiTestCase.php
index 1fbc7a2..873d979 100644
--- a/tests/phpunit/MediaWikiTestCase.php
+++ b/tests/phpunit/MediaWikiTestCase.php
@@ -1109,4 +1109,24 @@
 
                $this->assertEmpty( $errors, implode( "\n", $errors ) );
        }
+
+       /**
+        * Note: we are overriding this method to remove the deprecated error
+        * @see https://bugzilla.wikimedia.org/show_bug.cgi?id=69505
+        * @see https://github.com/sebastianbergmann/phpunit/issues/1292
+        *
+        * @param array $matcher
+        * @param string $actual
+        * @param string $message
+        * @param bool $isHtml
+        */
+       public static function assertTag($matcher, $actual, $message = '', 
$isHtml = true) {
+               //trigger_error(__METHOD__ . ' is deprecated', 
E_USER_DEPRECATED);
+
+               $dom     = PHPUnit_Util_XML::load($actual, $isHtml);
+               $tags    = PHPUnit_Util_XML::findNodes($dom, $matcher, $isHtml);
+               $matched = count($tags) > 0 && $tags[0] instanceof DOMNode;
+
+               self::assertTrue($matched, $message);
+       }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0eb63be390b4fdf416635dd8e8a2ad94615e6a47
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Addshore <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to