Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
assertResponseEquals example
$dispatcher
=
new
EventDispatcher
(
)
;
$kernel
=
$this
->
getHttpKernel
(
$dispatcher
,
fn
(
)
=>
$response
)
;
$this
->
assertSame
(
$response
,
$kernel
->
handle
(
new
Request
(
)
)
)
;
}
public
function
testHandleWhenTheControllerIsAnObjectWithInvoke
(
)
{
$dispatcher
=
new
EventDispatcher
(
)
;
$kernel
=
$this
->
getHttpKernel
(
$dispatcher
,
new
TestController
(
)
)
;
$this
->
assertResponseEquals
(
new
Response
(
'foo'
)
,
$kernel
->
handle
(
new
Request
(
)
)
)
;
}
public
function
testHandleWhenTheControllerIsAFunction
(
)
{
$dispatcher
=
new
EventDispatcher
(
)
;
$kernel
=
$this
->
getHttpKernel
(
$dispatcher
, 'Symfony\Component\HttpKernel\Tests\controller_func'
)
;
$this
->
assertResponseEquals
(
new
Response
(
'foo'
)
,
$kernel
->
handle
(
new
Request
(
)
)
)
;
}
public
function
testHandleWhenTheControllerIsAnArray
(
)
{