Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getTargetRoute example
$request
= Request::
create
(
'http://test.com/foo?bar=baz'
)
;
$response
=
new
RedirectResponse
(
'http://test.com/redirect'
)
;
$event
=
$this
->
createControllerEvent
(
$request
)
;
$collector
->
onKernelController
(
$event
)
;
$collector
->
collect
(
$request
,
$response
)
;
$this
->
assertTrue
(
$collector
->
getRedirect
(
)
)
;
$this
->
assertEquals
(
'http://test.com/redirect',
$collector
->
getTargetUrl
(
)
)
;
$this
->
assertEquals
(
'n/a',
$collector
->
getTargetRoute
(
)
)
;
}
public
function
testRouteNotRedirectResponse
(
)
{
$collector
=
new
RouterDataCollector
(
)
;
$request
= Request::
create
(
'http://test.com/foo?bar=baz'
)
;
$response
=
new
Response
(
'test'
)
;
$event
=
$this
->
createControllerEvent
(
$request
)
;