From 6d5eb092188a77c7270d7253486948083e5d3bb1 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Sat, 20 Feb 2021 15:48:03 +0100 Subject: [PATCH] MDL-71036 phpunit: XML load() method has been moved to new loader class 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. --- lib/phpunit/classes/base_testcase.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/phpunit/classes/base_testcase.php b/lib/phpunit/classes/base_testcase.php index f24c5624e2f..58b64df8a67 100644 --- a/lib/phpunit/classes/base_testcase.php +++ b/lib/phpunit/classes/base_testcase.php @@ -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); @@ -71,7 +71,7 @@ abstract class base_testcase extends PHPUnit\Framework\TestCase { * @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);