예제 #1
0
 public function testAcceptWithValueShouldShouldReturnFalse()
 {
     $stream = new TokenStream();
     $stream->addToken(new Token(Token::T_IDENT, 'correctvalue', 1));
     $parser = new Parser();
     $parser->parse($stream);
     $this->assertEquals(false, $parser->accept(Token::T_IDENT, 'wrongvalue'));
 }
예제 #2
0
 public function testGetTokenShouldThrowException()
 {
     $this->expectException(NoTokenAtIndex::class);
     $stream = new TokenStream();
     $stream->getToken(3);
 }