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