From 46a37534246204de9ec9c60f252f51bfe8e06227 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Thu, 26 Oct 2017 18:36:35 +0100 Subject: [PATCH] MDL-60139 phpunit: Make assertTag verify attribute values with === I had a test that cared about the difference between value="5.0" and value="5". --- lib/phpunit/classes/base_testcase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/phpunit/classes/base_testcase.php b/lib/phpunit/classes/base_testcase.php index 54eb63fa7ed31..8f78f4cfb356d 100644 --- a/lib/phpunit/classes/base_testcase.php +++ b/lib/phpunit/classes/base_testcase.php @@ -242,7 +242,7 @@ public static function findNodes(DOMDocument $dom, array $options, $isHtml = tru } } // match by exact string else { - if ($node->getAttribute($name) != $value) { + if ($node->getAttribute($name) !== (string) $value) { $invalid = true; } }