You are here

public function ScannerTest::testGetNumeric 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::testGetNumeric()

File

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

Class

ScannerTest

Namespace

Masterminds\HTML5\Tests\Parser

Code

public function testGetNumeric() {
  $s = new Scanner(new StringInputStream("1784a 45 9867 #"));
  $this
    ->assertEquals('1784', $s
    ->getNumeric());

  // Move past the 'a ' to scan the next group of text.
  $s
    ->next();
  $s
    ->next();
  $this
    ->assertEquals('45', $s
    ->getNumeric());
}