summaryrefslogtreecommitdiff
path: root/test/HTML5/Parser
diff options
context:
space:
mode:
authorMatt Butcher <[email protected]>2013-05-01 11:18:19 -0500
committerMatt Butcher <[email protected]>2013-05-01 11:18:19 -0500
commit27ba1335239833cba2bfcaeebc0c3195a535a004 (patch)
tree5e819f331aeb3b9e33d3e441ebcd830a0b6b2419 /test/HTML5/Parser
parentbe7f40d38223cf6cf4aa1ce180de9e3bd36672c5 (diff)
Fixed CDATA.
Diffstat (limited to 'test/HTML5/Parser')
-rw-r--r--test/HTML5/Parser/DOMTreeBuilderTest.php26
1 files changed, 24 insertions, 2 deletions
diff --git a/test/HTML5/Parser/DOMTreeBuilderTest.php b/test/HTML5/Parser/DOMTreeBuilderTest.php
index 562b9d5..d94c824 100644
--- a/test/HTML5/Parser/DOMTreeBuilderTest.php
+++ b/test/HTML5/Parser/DOMTreeBuilderTest.php
@@ -107,11 +107,25 @@ class DOMTreeBuilderTest extends \HTML5\Tests\TestCase {
}
public function testCDATA() {
- $this->markTestIncomplete("Incomplete.");
+ $html = "<!DOCTYPE html><html><mathml><![CDATA[test]]></mathml></html>";
+ $doc = $this->parse($html);
+
+ $wrapper = $doc->getElementsByTagName('mathml')->item(0);
+ $this->assertEquals(1, $wrapper->childNodes->length);
+ $cdata = $wrapper->childNodes->item(0);
+ $this->assertEquals(XML_CDATA_SECTION_NODE, $cdata->nodeType);
+ $this->assertEquals('test', $cdata->data);
}
public function testText() {
- $this->markTestIncomplete("Incomplete.");
+ $html = "<!DOCTYPE html><html><mathml>test</mathml></html>";
+ $doc = $this->parse($html);
+
+ $wrapper = $doc->getElementsByTagName('mathml')->item(0);
+ $this->assertEquals(1, $wrapper->childNodes->length);
+ $data = $wrapper->childNodes->item(0);
+ $this->assertEquals(XML_TEXT_NODE, $data->nodeType);
+ $this->assertEquals('test', $data->data);
}
public function testParseErrors() {
@@ -130,4 +144,12 @@ class DOMTreeBuilderTest extends \HTML5\Tests\TestCase {
$this->assertEquals(0, $p->childNodes->length);
$this->assertEquals('figure', $p->nextSibling->tagName);
}
+
+ public function testMathML() {
+ $this->markTestIncomplete("Incomplete.");
+ }
+
+ public function testSVG() {
+ $this->markTestIncomplete("Incomplete.");
+ }
}