diff options
Diffstat (limited to 'test/HTML5/Html5Test.php')
-rw-r--r-- | test/HTML5/Html5Test.php | 15 |
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>'; |