You are here

public function FileInputStreamTest::testCurrentLine in Zircon Profile 8

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

File

vendor/masterminds/html5/test/HTML5/Parser/FileInputStreamTest.php, line 92

Class

FileInputStreamTest

Namespace

Masterminds\HTML5\Tests\Parser

Code

public function testCurrentLine() {
  $s = new FileInputStream(__DIR__ . '/FileInputStreamTest.html');
  $this
    ->assertEquals(1, $s
    ->currentLine());

  // Make sure we get to the second line
  $s
    ->next();
  $s
    ->next();
  $s
    ->next();
  $s
    ->next();
  $s
    ->next();
  $s
    ->next();
  $s
    ->next();
  $s
    ->next();
  $s
    ->next();
  $s
    ->next();
  $s
    ->next();
  $s
    ->next();
  $s
    ->next();
  $s
    ->next();
  $s
    ->next();
  $s
    ->next();
  $this
    ->assertEquals(2, $s
    ->currentLine());

  // Make sure we get to the third line
  $s
    ->next();
  $s
    ->next();
  $s
    ->next();
  $s
    ->next();
  $s
    ->next();
  $s
    ->next();
  $s
    ->next();
  $s
    ->next();
  $s
    ->next();
  $s
    ->next();
  $s
    ->next();
  $s
    ->next();
  $s
    ->next();
  $s
    ->next();
  $s
    ->next();
  $s
    ->next();
  $s
    ->next();
  $this
    ->assertEquals(3, $s
    ->currentLine());
}