You are here

public function TokenStreamTest::testSkipWhitespace in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/css-selector/Tests/Parser/TokenStreamTest.php \Symfony\Component\CssSelector\Tests\Parser\TokenStreamTest::testSkipWhitespace()

File

vendor/symfony/css-selector/Tests/Parser/TokenStreamTest.php, line 82

Class

TokenStreamTest

Namespace

Symfony\Component\CssSelector\Tests\Parser

Code

public function testSkipWhitespace() {
  $stream = new TokenStream();
  $stream
    ->push($t1 = new Token(Token::TYPE_IDENTIFIER, 'h1', 0));
  $stream
    ->push($t2 = new Token(Token::TYPE_WHITESPACE, ' ', 2));
  $stream
    ->push($t3 = new Token(Token::TYPE_IDENTIFIER, 'h1', 3));
  $stream
    ->skipWhitespace();
  $this
    ->assertSame($t1, $stream
    ->getNext());
  $stream
    ->skipWhitespace();
  $this
    ->assertSame($t3, $stream
    ->getNext());
}