public function ScannerTest::testUnconsume in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/masterminds/html5/test/HTML5/Parser/ScannerTest.php \Masterminds\HTML5\Tests\Parser\ScannerTest::testUnconsume()
File
- vendor/
masterminds/ html5/ test/ HTML5/ Parser/ ScannerTest.php, line 68 - Test the Scanner. This requires the InputStream tests are all good.
Class
Namespace
Masterminds\HTML5\Tests\ParserCode
public function testUnconsume() {
$s = new Scanner(new StringInputStream("abcdefghijklmnopqrst"));
// Get initial position.
$s
->next();
$start = $s
->position();
// Move forward a bunch of positions.
$amount = 7;
for ($i = 0; $i < $amount; $i++) {
$s
->next();
}
// Roll back the amount we moved forward.
$s
->unconsume($amount);
$this
->assertEquals($start, $s
->position());
}