Commit 8a3663b1 authored by Eloy Lafuente's avatar Eloy Lafuente
Browse files

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.
parent 857f6385
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment