You are here

public function TokenStreamTest::testGetPeek in Zircon Profile 8

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

File

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

Class

TokenStreamTest

Namespace

Symfony\Component\CssSelector\Tests\Parser

Code

public function testGetPeek() {
  $stream = new TokenStream();
  $stream
    ->push($t1 = new Token(Token::TYPE_IDENTIFIER, 'h1', 0));
  $stream
    ->push($t2 = new Token(Token::TYPE_DELIMITER, '.', 2));
  $stream
    ->push($t3 = new Token(Token::TYPE_IDENTIFIER, 'title', 3));
  $this
    ->assertSame($t1, $stream
    ->getPeek());
  $this
    ->assertSame($t1, $stream
    ->getNext());
  $this
    ->assertSame($t2, $stream
    ->getPeek());
  $this
    ->assertSame($t2, $stream
    ->getPeek());
  $this
    ->assertSame($t2, $stream
    ->getNext());
}