From 91b652ac58e859f4278aefb8bb275260a2fe1929 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Wed, 30 Sep 2009 16:54:49 +0000 Subject: [PATCH] unittests: NOBUG further fix to HTML expectations. --- lib/simpletest/testsimpletestlib.php | 6 ++++++ lib/simpletestlib.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/simpletest/testsimpletestlib.php b/lib/simpletest/testsimpletestlib.php index 30408e7e45..50791bccb8 100644 --- a/lib/simpletest/testsimpletestlib.php +++ b/lib/simpletest/testsimpletestlib.php @@ -70,6 +70,12 @@ class ContainsTagWithAttribute_test extends UnitTestCase { $html = 'Click here'; $this->assert(new ContainsTagWithAttribute('a', 'href', 'http://otheraddress.com'), $html); } + + function test_real_regression1() { + $expectation = new ContainsTagWithAttribute('label', 'for', 'html_select4ac387224bf9d'); + $html = ''; + $this->assert($expectation, $html); + } } /** diff --git a/lib/simpletestlib.php b/lib/simpletestlib.php index 0f36dd7dc4..400b22ad99 100644 --- a/lib/simpletestlib.php +++ b/lib/simpletestlib.php @@ -196,7 +196,7 @@ abstract class XMLStructureExpectation extends SimpleExpectation { protected function load_xml($html) { $prevsetting = libxml_use_internal_errors(true); $parser = new DOMDocument(); - if (!$parser->loadXML($html)) { + if (!$parser->loadXML('' . $html . '')) { $parser = new DOMDocument(); } libxml_use_internal_errors($prevsetting); -- 2.39.5