From c5099f50fd68f26741d061cff5a3ccd086e00cfe Mon Sep 17 00:00:00 2001 From: Matt Butcher Date: Wed, 1 May 2013 14:55:36 -0500 Subject: Fixes for PI tests. --- test/HTML5/Parser/DOMTreeBuilderTest.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/HTML5/Parser/DOMTreeBuilderTest.php b/test/HTML5/Parser/DOMTreeBuilderTest.php index 677bac6..53d1480 100644 --- a/test/HTML5/Parser/DOMTreeBuilderTest.php +++ b/test/HTML5/Parser/DOMTreeBuilderTest.php @@ -139,7 +139,20 @@ class DOMTreeBuilderTest extends \HTML5\Tests\TestCase { } public function testProcessingInstruction() { - $this->markTestIncomplete("Incomplete."); + // Test the simple case, which is where PIs are inserted into the DOM. + $doc = $this->parse(''); + $this->assertEquals(1, $doc->documentElement->childNodes->length); + $pi = $doc->documentElement->firstChild; + $this->assertInstanceOf('\DOMProcessingInstruction', $pi); + $this->assertEquals('foo', $pi->nodeName); + $this->assertEquals('bar', $pi->data); + + // Leading xml PIs should be ignored. + $doc = $this->parse(''); + + $this->assertEquals(2, $doc->childNodes->length); + $this->assertInstanceOf('\DOMDocumentType', $doc->childNodes->item(0)); + $this->assertInstanceOf('\DOMElement', $doc->childNodes->item(1)); } public function testAutocloseP() { -- cgit v1.2.3