You are here

public function ScannerTest::testCurrent in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/masterminds/html5/test/HTML5/Parser/ScannerTest.php \Masterminds\HTML5\Tests\Parser\ScannerTest::testCurrent()

File

vendor/masterminds/html5/test/HTML5/Parser/ScannerTest.php, line 53
Test the Scanner. This requires the InputStream tests are all good.

Class

ScannerTest

Namespace

Masterminds\HTML5\Tests\Parser

Code

public function testCurrent() {
  $s = new Scanner(new StringInputStream("abc"));

  // Before scanning the string begins the current is empty.
  $this
    ->assertEquals('a', $s
    ->current());
  $c = $s
    ->next();
  $this
    ->assertEquals('b', $s
    ->current());

  // Test movement through the string.
  $c = $s
    ->next();
  $this
    ->assertEquals('c', $s
    ->current());
}