use Symfony\Component\CssSelector\Parser\TokenStream;
class TokenStreamTest extends TestCase
{ public function testGetNext() { $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->
getNext());
$this->
assertSame($t2,
$stream->
getNext());
$this->
assertSame($t3,
$stream->
getNext());
} 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
));