Nelmio\Alice\FixtureBuilder\ExpressionLanguage\Parser\TokenParser\Chainable\ParameterTokenParserTest::testThrowsAnErrorIfPassedParameterIsMalformed PHP Method

testThrowsAnErrorIfPassedParameterIsMalformed() public method

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