You are here

public function TreeBuildingRulesTest::testTable in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/masterminds/html5/test/HTML5/Parser/TreeBuildingRulesTest.php \Masterminds\HTML5\Tests\Parser\TreeBuildingRulesTest::testTable()

File

vendor/masterminds/html5/test/HTML5/Parser/TreeBuildingRulesTest.php, line 93
Test the Tree Builder's special-case rules.

Class

TreeBuildingRulesTest
These tests are functional, not necessarily unit tests.

Namespace

Masterminds\HTML5\Tests\Parser

Code

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);
}