Matthias\SymfonyServiceDefinitionValidator\Tests\ArgumentValidatorTest::testFailsWhenOptionalParameterHasArrayTypeHintAndResultOfExpressionIsNullButNullIsNotAllowed PHP Method

testFailsWhenOptionalParameterHasArrayTypeHintAndResultOfExpressionIsNullButNullIsNotAllowed() public method

    public function testFailsWhenOptionalParameterHasArrayTypeHintAndResultOfExpressionIsNullButNullIsNotAllowed()
    {
        $class = 'Matthias\\SymfonyServiceDefinitionValidator\\Tests\\Fixtures\\ClassWithOptionalArrayConstructorArgument';
        $parameter = new \ReflectionParameter(array($class, '__construct'), 'options');
        $argument = null;
        $validator = new ArgumentValidator(new ContainerBuilder(), $this->createMockResultingClassResolver());
        try {
            $validator->validate($parameter, $argument);
        } catch (TypeHintMismatchException $exception) {
            $this->fail('null argument should be allowed');
        }
    }