Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit 7b36738

Browse files
committed
fixing failed test on old php
loadHTML with options is not present in php < 5.4 so just make the case with loadXML
1 parent b9d5062 commit 7b36738

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tests/Zend/Dom/QueryTest.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,14 +233,20 @@ public function testQueryXpathShouldAllowQueryingArbitraryUsingXpath()
233233

234234
public function testQueryOnDomDocument()
235235
{
236-
$document = new DOMDocument('1.0', 'utf-8');
237-
$document->loadHTML($this->getHtml(), LIBXML_PARSEHUGE);
236+
$xml = <<<EOF
237+
<?xml version="1.0" encoding="UTF-8" ?>
238+
<foo>
239+
<bar class="baz"/>
240+
</foo>
241+
EOF;
242+
$document = new DOMDocument();
243+
$document->loadXML($xml, LIBXML_PARSEHUGE);
238244
$this->query->setDocument($document);
239-
$test = $this->query->query('.foo');
245+
$test = $this->query->query('.baz');
240246
$this->assertTrue($test instanceof Zend_Dom_Query_Result);
241247
$testDocument = $test->getDocument();
242248
$this->assertTrue($testDocument instanceof DOMDocument);
243-
$this->assertEquals('utf-8', $testDocument->encoding);
249+
$this->assertEquals('UTF-8', $testDocument->encoding);
244250
}
245251

246252
/**

0 commit comments

Comments
 (0)