public function testThrowsAnExceptionIfCouldNotParseToken()
{
try {
$token = new Token('', new TokenType(TokenType::VARIABLE_TYPE));
$parser = new VariableTokenParser(new FakeParser());
$parser->parse($token);
$this->fail('Expected exception to be thrown.');
} catch (ParseException $exception) {
$this->assertEquals('Could not parse the token "" (type: VARIABLE_TYPE).', $exception->getMessage());
$this->assertEquals(0, $exception->getCode());
$this->assertNotNull($exception->getPrevious());
}
}