public function TokenizerTest::testComment in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/masterminds/html5/test/HTML5/Parser/TokenizerTest.php \Masterminds\HTML5\Tests\Parser\TokenizerTest::testComment()
File
- vendor/
masterminds/ html5/ test/ HTML5/ Parser/ TokenizerTest.php, line 194
Class
Namespace
Masterminds\HTML5\Tests\ParserCode
public function testComment() {
$good = array(
'<!--easy-->' => 'easy',
'<!-- 1 > 0 -->' => ' 1 > 0 ',
'<!-- --$i -->' => ' --$i ',
'<!----$i-->' => '--$i',
'<!-- 1 > 0 -->' => ' 1 > 0 ',
"<!--\nHello World.\na-->" => "\nHello World.\na",
'<!-- <!-- -->' => ' <!-- ',
);
foreach ($good as $test => $expected) {
$events = $this
->parse($test);
$this
->assertEventEquals('comment', $expected, $events
->get(0));
}
$fail = array(
'<!-->' => '',
'<!--Hello' => 'Hello',
"<!--\0Hello" => UTF8Utils::FFFD . 'Hello',
'<!--' => '',
);
foreach ($fail as $test => $expected) {
$events = $this
->parse($test);
$this
->assertEquals(3, $events
->depth());
$this
->assertEventError($events
->get(0));
$this
->assertEventEquals('comment', $expected, $events
->get(1));
}
}