Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
controllerTargetingResolver example
$controller
=
$this
->
controllerWithExtendingSession
(
...
)
;
self::
getResolver
(
)
->
getArguments
(
$request
,
$controller
)
;
}
public
function
testTargetedResolver
(
)
{
$resolver
= self::
getResolver
(
[
]
,
[
DefaultValueResolver::
class
=>
new
DefaultValueResolver
(
)
]
)
;
$request
= Request::
create
(
'/'
)
;
$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
(
...
)
;