summaryrefslogtreecommitdiff
path: root/test/HTML5/Parser/DOMTreeBuilderTest.php
diff options
context:
space:
mode:
authorAsmir Mustafic <[email protected]>2014-11-24 17:15:44 +0100
committerAsmir Mustafic <[email protected]>2014-11-24 17:15:44 +0100
commitca8ed88fa5ad706c6b38413315d6f556034e6a22 (patch)
tree7865f50ccab69be5947130776014446cb4e1d035 /test/HTML5/Parser/DOMTreeBuilderTest.php
parentf50e87904ed0857ea2dead2ae4facf7d95c743fd (diff)
Case insensitive tags
fixes #63
Diffstat (limited to 'test/HTML5/Parser/DOMTreeBuilderTest.php')
-rw-r--r--test/HTML5/Parser/DOMTreeBuilderTest.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/HTML5/Parser/DOMTreeBuilderTest.php b/test/HTML5/Parser/DOMTreeBuilderTest.php
index 5227c40..f9323ed 100644
--- a/test/HTML5/Parser/DOMTreeBuilderTest.php
+++ b/test/HTML5/Parser/DOMTreeBuilderTest.php
@@ -56,6 +56,29 @@ class DOMTreeBuilderTest extends \Masterminds\HTML5\Tests\TestCase
$this->assertInstanceOf('\DOMDocument', $doc);
$this->assertEquals('html', $doc->documentElement->tagName);
}
+
+ public function testStrangeCapitalization()
+ {
+ $html = "<!doctype html>
+ <html>
+ <head>
+ <Title>Hello, world!</Title>
+ </head>
+ <body>TheBody</body>
+ </html>";
+ $doc = $this->parse($html);
+
+ $this->assertInstanceOf('\DOMDocument', $doc);
+ $this->assertEquals('html', $doc->documentElement->tagName);
+
+ $xpath = new \DOMXPath( $doc );
+ $xpath->registerNamespace( "x", "http://www.w3.org/1999/xhtml" );
+
+ $this->assertEquals("Hello, world!", $xpath->query( "//x:title" )->item( 0 )->nodeValue);
+ $this->assertEquals("TheBody", $xpath->query( "//x:body" )->item( 0 )->nodeValue);
+
+ }
+
public function testDocumentFakeAttrAbsence()
{
$html = "<!DOCTYPE html><html xmlns=\"http://www.w3.org/1999/xhtml\"><body>foo</body></html>";