controllerTargetingResolverWithDefaultValue example

$request->attributes->set('foo', 'bar');
        $controller = $this->controllerTargetingResolver(...);

        $this->assertSame([1]$resolver->getArguments($request$controller));
    }

    public function testTargetedResolverWithDefaultValue()
    {
        $resolver = self::getResolver([][RequestAttributeValueResolver::class => new RequestAttributeValueResolver()]);

        $request = Request::create('/');
        $controller = $this->controllerTargetingResolverWithDefaultValue(...);

        $this->assertSame([2]$resolver->getArguments($request$controller));
    }

    public function testTargetedResolverWithNullableValue()
    {
        $resolver = self::getResolver([][RequestAttributeValueResolver::class => new RequestAttributeValueResolver()]);

        $request = Request::create('/');
        $controller = $this->controllerTargetingResolverWithNullableValue(...);

        
Home | Imprint | This part of the site doesn't use cookies.