Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
TwigErrorRenderer example
$exception
=
new
\
Exception
(
)
;
$twig
=
$this
->
createMock
(
Environment::
class
)
;
$nativeRenderer
=
$this
->
createMock
(
HtmlErrorRenderer::
class
)
;
$nativeRenderer
->
expects
(
$this
->
once
(
)
)
->
method
(
'render'
)
->
with
(
$exception
)
;
(
new
TwigErrorRenderer
(
$twig
,
$nativeRenderer
, true
)
)
->
render
(
new
\
Exception
(
)
)
;
}
public
function
testFallbackToNativeRendererIfCustomTemplateNotFound
(
)
{
$exception
=
new
NotFoundHttpException
(
)
;
$twig
=
new
Environment
(
new
ArrayLoader
(
[
]
)
)
;
$nativeRenderer
=
$this
->
createMock
(
HtmlErrorRenderer::
class
)
;
$nativeRenderer
->
expects
(
$this
->
once
(
)
)