$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
));
$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());
} public function testGetNextIdentifier() { $stream =
new TokenStream();
$stream->
push(new Token(Token::TYPE_IDENTIFIER, 'h1', 0
));