mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 16:04:25 +02:00
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.
This commit is contained in:
parent
857f6385a4
commit
8a3663b175
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user