From ca8ed88fa5ad706c6b38413315d6f556034e6a22 Mon Sep 17 00:00:00 2001 From: Asmir Mustafic Date: Mon, 24 Nov 2014 17:15:44 +0100 Subject: Case insensitive tags fixes #63 --- test/HTML5/Parser/DOMTreeBuilderTest.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'test/HTML5/Parser') 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 = " + + + Hello, world! + + TheBody + "; + $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 = "foo"; -- cgit v1.2.3