diff options
author | Matt Farina <[email protected]> | 2013-11-04 16:57:29 -0500 |
---|---|---|
committer | Matt Farina <[email protected]> | 2013-11-04 16:57:29 -0500 |
commit | 10e129bd8be814b3b8a327416c2c4e1d67b0f678 (patch) | |
tree | 7ceb1576d808bd8802fc004d9f81aa4f29ee58ed /test/HTML5/Parser/TreeBuildingRulesTest.php | |
parent | 246ed7785e93cc1ebf59a2f15af61472d20efca0 (diff) |
#20 Some of the parser rules, for special cases, were not returning the element to use as the current element. This caused the current parser element to get messed up.
Diffstat (limited to 'test/HTML5/Parser/TreeBuildingRulesTest.php')
-rw-r--r-- | test/HTML5/Parser/TreeBuildingRulesTest.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/HTML5/Parser/TreeBuildingRulesTest.php b/test/HTML5/Parser/TreeBuildingRulesTest.php index fe02893..a247cea 100644 --- a/test/HTML5/Parser/TreeBuildingRulesTest.php +++ b/test/HTML5/Parser/TreeBuildingRulesTest.php @@ -62,4 +62,15 @@ class TreeBuildingRulesTest extends \HTML5\Tests\TestCase { $this->assertEquals('dd', $list->lastChild->tagName); } + public function testTable() { + $html = sprintf(self::HTML_STUB, '<table><thead id="a"><th>foo<td>bar<td>baz'); + $doc = $this->parse($html); + + $list = $doc->getElementById('a'); + + $this->assertEquals(3, $list->childNodes->length); + $this->assertEquals('th', $list->firstChild->tagName); + $this->assertEquals('td', $list->lastChild->tagName); + } + } |