public function DOMTreeBuilderTest::testImplicitNamespaces in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/masterminds/html5/test/HTML5/Parser/DOMTreeBuilderTest.php \Masterminds\HTML5\Tests\Parser\DOMTreeBuilderTest::testImplicitNamespaces()
File
- vendor/
masterminds/ html5/ test/ HTML5/ Parser/ DOMTreeBuilderTest.php, line 147 - Test the Tree Builder.
Class
- DOMTreeBuilderTest
- These tests are functional, not necessarily unit tests.
Namespace
Masterminds\HTML5\Tests\ParserCode
public function testImplicitNamespaces() {
$dom = $this
->parse('<!DOCTYPE html><html><body><a xlink:href="bar">foo</a></body></html>');
$a = $dom
->getElementsByTagName('a')
->item(0);
$attr = $a
->getAttributeNode('xlink:href');
$this
->assertEquals('http://www.w3.org/1999/xlink', $attr->namespaceURI);
$dom = $this
->parse('<!DOCTYPE html><html><body><a xml:base="bar">foo</a></body></html>');
$a = $dom
->getElementsByTagName('a')
->item(0);
$attr = $a
->getAttributeNode('xml:base');
$this
->assertEquals('http://www.w3.org/XML/1998/namespace', $attr->namespaceURI);
}