You are here

public function DOMTreeBuilderTest::testStrangeCapitalization in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/masterminds/html5/test/HTML5/Parser/DOMTreeBuilderTest.php \Masterminds\HTML5\Tests\Parser\DOMTreeBuilderTest::testStrangeCapitalization()

File

vendor/masterminds/html5/test/HTML5/Parser/DOMTreeBuilderTest.php, line 61
Test the Tree Builder.

Class

DOMTreeBuilderTest
These tests are functional, not necessarily unit tests.

Namespace

Masterminds\HTML5\Tests\Parser

Code

public function testStrangeCapitalization() {
  $html = "<!doctype html>\n        <html>\n            <head>\n                <Title>Hello, world!</TitlE>\n            </head>\n            <body>TheBody<script>foo</script></body>\n        </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("foo", $xpath
    ->query("//x:script")
    ->item(0)->nodeValue);
}