Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
controllerTargetingResolverWithNullableValue example
$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
(
...
)
;
$this
->
assertSame
(
[
null
]
,
$resolver
->
getArguments
(
$request
,
$controller
)
)
;
}
public
function
testDisabledResolver
(
)
{
$resolver
= self::
getResolver
(
namedResolvers:
[
]
)
;
$request
= Request::
create
(
'/'
)
;
$request
->attributes->
set
(
'foo', 'bar'
)
;
$controller
=
$this
->
controllerDisablingResolver
(
...
)
;