Nelmio\Alice\Throwable\Exception\FixtureBuilder\ExpressionLanguage\ExpressionLanguageExceptionFactoryTest::testTestCreateForUnparsableToken PHP Method

testTestCreateForUnparsableToken() public method

    public function testTestCreateForUnparsableToken()
    {
        $token = new Token('foo', new TokenType(TokenType::DYNAMIC_ARRAY_TYPE));
        $exception = ExpressionLanguageExceptionFactory::createForUnparsableToken($token);
        $this->assertEquals('Could not parse the token "foo" (type: DYNAMIC_ARRAY_TYPE).', $exception->getMessage());
        $this->assertEquals(0, $exception->getCode());
        $this->assertNull($exception->getPrevious());
        $code = 500;
        $previous = new \Error();
        $exception = ExpressionLanguageExceptionFactory::createForUnparsableToken($token, $code, $previous);
        $this->assertEquals('Could not parse the token "foo" (type: DYNAMIC_ARRAY_TYPE).', $exception->getMessage());
        $this->assertEquals($code, $exception->getCode());
        $this->assertSame($previous, $exception->getPrevious());
    }