You are a developer and looking for Shopware projects?
Apply Now!
ControllerTest example
$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
(
)
;
$request
= Request::
create
(
'/'
)
;
$request
->attributes->
set
(
'_controller',
[
$object
, 'publicAction'
]
)
;
$controller
=
$resolver
->
getController
(
$request
)
;
$this
->
assertSame
(
[
$object
, 'publicAction'
]
,
$controller
)
;
}
public
function
testGetControllerWithClassAndMethodAsArray
(
)
{
$resolver
=
$this
->
createControllerResolver
(
)
;