Skip to content

Commit 0d89c22

Browse files
committed
removed loop and renamed test
1 parent 585eb79 commit 0d89c22

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/HTML5/Parser/TreeBuildingRulesTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,17 @@ public function testHandleDT()
9090
$this->assertEquals('dd', $list->lastChild->tagName);
9191
}
9292

93-
public function testHandleOption()
93+
public function testHandleOptionGroupAndOption()
9494
{
95-
$html = sprintf(self::HTML_STUB, '<optgroup id="foo" label="foo" ><option value="foo" >bar</option></optgroup>');
95+
$html = sprintf(self::HTML_STUB, '<optgroup id="foo" label="foo" ><option value="foo">bar</option></optgroup>');
9696
$doc = $this->parse($html);
9797

9898
$list = $doc->getElementById('foo');
9999

100100
$this->assertEquals(1, $list->childNodes->length);
101-
foreach ($list->childNodes as $ele) {
102-
$this->assertEquals('option', $ele->tagName);
103-
}
101+
102+
$option = $list->childNodes->item(0);
103+
$this->assertEquals('option', $option->tagName);
104104
}
105105

106106
public function testTable()

0 commit comments

Comments
 (0)