Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
InvokableController example
$resolver
=
$this
->
createControllerResolver
(
)
;
$request
= Request::
create
(
'/'
)
;
$request
->attributes->
set
(
'_controller',
$lambda
=
function
D
)
{
}
)
;
$controller
=
$resolver
->
getController
(
$request
)
;
$this
->
assertSame
(
$lambda
,
$controller
)
;
}
public
function
testGetControllerWithObjectAndInvokeMethod
(
)
{
$resolver
=
$this
->
createControllerResolver
(
)
;
$object
=
new
InvokableController
(
)
;
$request
= Request::
create
(
'/'
)
;
$request
->attributes->
set
(
'_controller',
$object
)
;
$controller
=
$resolver
->
getController
(
$request
)
;
$this
->
assertSame
(
$object
,
$controller
)
;
}
public
function
testGetControllerWithObjectAndMethod
(
)
{
$resolver
=
$this
->
createControllerResolver
(
)
;
$object
=
new
ControllerTest
(
)
;