summaryrefslogtreecommitdiff
path: root/test/HTML5
diff options
context:
space:
mode:
authorAsmir Mustafic <[email protected]>2015-06-07 12:09:33 +0200
committerAsmir Mustafic <[email protected]>2015-06-07 12:11:25 +0200
commit5d415a86f7465566967d8bb602a957010ae27d5b (patch)
tree71ed350c21d0c8e448fd0fd6f9c444b69ba3a21f /test/HTML5
parent8f782e0f01a6e33a319bdc8f6de9cfd6569979a4 (diff)
Allow multiple root nodes
Diffstat (limited to 'test/HTML5')
-rw-r--r--test/HTML5/Html5Test.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/HTML5/Html5Test.php b/test/HTML5/Html5Test.php
index cce58b7..23cb424 100644
--- a/test/HTML5/Html5Test.php
+++ b/test/HTML5/Html5Test.php
@@ -92,6 +92,21 @@ class Html5Test extends TestCase
$this->assertEmpty($this->html5->getErrors());
}
+ public function testLoadHTMLWithComments()
+ {
+ $contents = '<!--[if lte IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
+<!--[if gt IE 8]> <!--><html class="no-js" lang="en"><!--<![endif]-->
+</html>';
+
+ $dom = $this->html5->loadHTML($contents);
+ $this->assertInstanceOf('\DOMDocument', $dom);
+
+ $expected = '<!DOCTYPE html>
+<!--[if lte IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]--><!--[if gt IE 8]> <!--><html class="no-js" lang="en"><!--<![endif]--></html>
+';
+ $this->assertEquals($expected, $this->html5->saveHTML($dom));
+ }
+
public function testLoadHTMLFragment()
{
$fragment = '<section id="Foo"><div class="Bar">Baz</div></section>';