Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
onDocumentRendering example
$request
= Request::
createFromGlobals
(
)
;
$event
=
new
DocumentTemplateRendererParameterEvent
(
$parameters
)
;
$themeLoader
=
$this
->
createMock
(
SalesChannelThemeLoader::
class
)
;
$themeLoader
->
method
(
'load'
)
->
willReturn
(
[
'themeName' =>
$usingTheme
,
'parentThemeName' => null,
]
)
;
$builder
=
new
ThemeNamespaceHierarchyBuilder
(
new
TestInheritanceBuilder
(
)
,
$themeLoader
)
;
$builder
->
onDocumentRendering
(
$event
)
;
$this
->
assertThemes
(
$expectedThemes
,
$builder
)
;
$builder
=
new
ThemeNamespaceHierarchyBuilder
(
new
TestInheritanceBuilder
(
)
,
$themeLoader
)
;
$builder
->
requestEvent
(
new
ExceptionEvent
(
$this
->
createMock
(
HttpKernelInterface::
class
)
,
$request
, HttpKernelInterface::MAIN_REQUEST,
new
\
RuntimeException
(
)
)
)
;
$this
->
assertThemes
(
[
]
,
$builder
)
;
}
public
function
testRequestEventWithExceptionEvent
(
)
: void
{