diff options
author | Matt Farina <[email protected]> | 2013-07-01 10:16:22 -0400 |
---|---|---|
committer | Matt Farina <[email protected]> | 2013-07-01 10:16:22 -0400 |
commit | a9149e8852ec3b0a2e8bb31285c37b46a8fb52e3 (patch) | |
tree | 7afeec0533e2b55f384e367f0263eab98bede2db | |
parent | a5361e80a3de563e4ffc555088ccc6c542e09e43 (diff) |
Added svg test that handles elements. Note, attribute tests were already done.
-rw-r--r-- | test/HTML5/Parser/DOMTreeBuilderTest.php | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/test/HTML5/Parser/DOMTreeBuilderTest.php b/test/HTML5/Parser/DOMTreeBuilderTest.php index b6ee977..d1010e2 100644 --- a/test/HTML5/Parser/DOMTreeBuilderTest.php +++ b/test/HTML5/Parser/DOMTreeBuilderTest.php @@ -259,6 +259,28 @@ class DOMTreeBuilderTest extends \HTML5\Tests\TestCase { } public function testSVG() { - $this->markTestIncomplete("Incomplete."); + $html = '<!doctype html> + <html lang="en"> + <body> + <svg width="150" height="100" viewBox="0 0 3 2" xmlns="http://www.w3.org/2000/svg"> + <rect width="1" height="2" x="2" fill="#d2232c" /> + <text font-family="Verdana" font-size="32"> + <textpath xlink:href="#Foo"> + Test Text. + </textPath> + </text> + </svg> + </body> + </html>'; + + $doc = $this->parse($html); + $svg = $doc->getElementsByTagName('svg')->item(0); + $this->assertEquals('svg', $svg->tagName); + $this->assertEquals('svg', $svg->nodeName); + $this->assertEquals('svg', $svg->localName); + $this->assertEmpty($svg->namespaceURI); + + $textPath = $doc->getElementsByTagName('textPath')->item(0); + $this->assertEquals('textPath', $textPath->tagName); } } |