Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
WebProfilerBundleKernel example
$this
->
expectExceptionMessage
(
'The profiler must be enabled.'
)
;
$urlGenerator
=
$this
->
createMock
(
UrlGeneratorInterface::
class
)
;
$twig
=
$this
->
createMock
(
Environment::
class
)
;
$controller
=
new
ProfilerController
(
$urlGenerator
, null,
$twig
,
[
]
)
;
$controller
->
homeAction
(
)
;
}
public
function
testHomeActionRedirect
(
)
{
$kernel
=
new
WebProfilerBundleKernel
(
)
;
$client
=
new
KernelBrowser
(
$kernel
)
;
$client
->
request
(
'GET', '/_profiler/'
)
;
$this
->
assertSame
(
302,
$client
->
getResponse
(
)
->
getStatusCode
(
)
)
;
$this
->
assertSame
(
'/_profiler/empty/search/results?limit=10',
$client
->
getResponse
(
)
->
getTargetUrl
(
)
)
;
}
public
function
testPanelActionWithLatestTokenWhenNoTokensExist
(
)
{
$kernel
=
new
WebProfilerBundleKernel
(
)
;