Skip to content

Commit

Permalink
MDL-71036 phpunit: XML load() method has been moved to new loader class
Browse files Browse the repository at this point in the history
Used by our custom assertTag() and assertNotTag() assertions, that some
day we should deprecate... the loading of XML content for further
processing has been moved to new classes within the PHPUnit utils. We
are just following the move here.
  • Loading branch information
stronk7 committed Mar 11, 2021
1 parent 857f638 commit 8a3663b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/phpunit/classes/base_testcase.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ abstract class base_testcase extends PHPUnit\Framework\TestCase {
* @deprecated 3.0
*/
public static function assertTag($matcher, $actual, $message = '', $ishtml = true) {
$dom = PHPUnit\Util\XML::load($actual, $ishtml);
$dom = (new PHPUnit\Util\Xml\Loader)->load($actual, $ishtml);
$tags = self::findNodes($dom, $matcher, $ishtml);
$matched = count($tags) > 0 && $tags[0] instanceof DOMNode;
self::assertTrue($matched, $message);
Expand All @@ -71,7 +71,7 @@ public static function assertTag($matcher, $actual, $message = '', $ishtml = tru
* @deprecated 3.0
*/
public static function assertNotTag($matcher, $actual, $message = '', $ishtml = true) {
$dom = PHPUnit\Util\XML::load($actual, $ishtml);
$dom = (new PHPUnit\Util\Xml\Loader)->load($actual, $ishtml);
$tags = self::findNodes($dom, $matcher, $ishtml);
$matched = (is_array($tags) && count($tags) > 0) && $tags[0] instanceof DOMNode;
self::assertFalse($matched, $message);
Expand Down

0 comments on commit 8a3663b

Please sign in to comment.