You are here

public function StringInputStreamTest::testCharsWhile in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/masterminds/html5/test/HTML5/Parser/StringInputStreamTest.php \Masterminds\HTML5\Tests\Parser\StringInputStreamTest::testCharsWhile()

File

vendor/masterminds/html5/test/HTML5/Parser/StringInputStreamTest.php, line 148

Class

StringInputStreamTest

Namespace

Masterminds\HTML5\Tests\Parser

Code

public function testCharsWhile() {
  $text = "abcdefffffffghi";
  $s = new StringInputStream($text);
  $this
    ->assertEquals('ab', $s
    ->charsWhile('ba'));
  $this
    ->assertEquals('', $s
    ->charsWhile('a'));
  $this
    ->assertEquals('cde', $s
    ->charsWhile('cdeba'));
  $this
    ->assertEquals('ff', $s
    ->charsWhile('f', 2));
  $this
    ->assertEquals('fffff', $s
    ->charsWhile('f'));
  $this
    ->assertEquals('g', $s
    ->charsWhile('fg'));
  $this
    ->assertEquals('hi', $s
    ->charsWhile('fghi', 99));
}