public function TokenizerTest::testCharacterReference 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::testCharacterReference()
File
- vendor/
masterminds/ html5/ test/ HTML5/ Parser/ TokenizerTest.php, line 93
Class
Namespace
Masterminds\HTML5\Tests\ParserCode
public function testCharacterReference() {
$good = array(
'&' => '&',
'<' => '<',
'&' => '&',
'&' => '&',
);
$this
->isAllGood('text', 2, $good);
// Test with broken charref
$str = '&foo';
$events = $this
->parse($str);
$e1 = $events
->get(0);
$this
->assertEquals('error', $e1['name']);
$str = 'oo';
$events = $this
->parse($str);
$e1 = $events
->get(0);
$this
->assertEquals('error', $e1['name']);
$str = '&#foo';
$events = $this
->parse($str);
$e1 = $events
->get(0);
$this
->assertEquals('error', $e1['name']);
// FIXME: Once the text processor is done, need to verify that the
// tokens are transformed correctly into text.
}