summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsmir Mustafic <[email protected]>2016-09-22 12:33:58 +0200
committerAsmir Mustafic <[email protected]>2016-09-22 12:37:38 +0200
commit0d89c22d28c4c5ef75a04874b1451c25c125820b (patch)
treeba6d287c620ff6e6c40a891b2eb0a51b80bb5160
parent585eb79ba6e41399780380e9cbf61012bc8b440b (diff)
removed loop and renamed test
-rw-r--r--test/HTML5/Parser/TreeBuildingRulesTest.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/HTML5/Parser/TreeBuildingRulesTest.php b/test/HTML5/Parser/TreeBuildingRulesTest.php
index 59d65a2..de94d06 100644
--- a/test/HTML5/Parser/TreeBuildingRulesTest.php
+++ b/test/HTML5/Parser/TreeBuildingRulesTest.php
@@ -90,17 +90,17 @@ class TreeBuildingRulesTest extends \Masterminds\HTML5\Tests\TestCase
$this->assertEquals('dd', $list->lastChild->tagName);
}
- public function testHandleOption()
+ public function testHandleOptionGroupAndOption()
{
- $html = sprintf(self::HTML_STUB, '<optgroup id="foo" label="foo" ><option value="foo" >bar</option></optgroup>');
+ $html = sprintf(self::HTML_STUB, '<optgroup id="foo" label="foo" ><option value="foo">bar</option></optgroup>');
$doc = $this->parse($html);
$list = $doc->getElementById('foo');
$this->assertEquals(1, $list->childNodes->length);
- foreach ($list->childNodes as $ele) {
- $this->assertEquals('option', $ele->tagName);
- }
+
+ $option = $list->childNodes->item(0);
+ $this->assertEquals('option', $option->tagName);
}
public function testTable()