Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
onGetConcatenatedScripts example
static
::
assertEquals
(
$expected
,
$actual
)
;
}
public
function
testConcanatedScriptsEventPassThrough
(
)
: void
{
$subscriber
=
new
MockThemeCompilerConcatenatedSubscriber
(
)
;
$scripts
= 'console.log(\'foo\');';
$event
=
new
ThemeCompilerConcatenatedScriptsEvent
(
$scripts
,
$this
->mockSalesChannelId
)
;
$subscriber
->
onGetConcatenatedScripts
(
$event
)
;
$actual
=
$event
->
getConcatenatedScripts
(
)
;
$expected
=
$scripts
. MockThemeCompilerConcatenatedSubscriber::SCRIPTS_CONCAT;
static
::
assertEquals
(
$expected
,
$actual
)
;
}
public
function
testDBException
(
)
: void
{
$configService
=
$this
->
getConfigurationServiceDbException
(
[
static
::
assertEquals
(
$expected
,
$actual
)
;
}
public
function
testConcanatedScriptsEventPassThrough
(
)
: void
{
$subscriber
=
new
MockThemeCompilerConcatenatedSubscriber
(
)
;
$scripts
= 'console.log(\'foo\');';
$event
=
new
ThemeCompilerConcatenatedScriptsEvent
(
$scripts
,
$this
->mockSalesChannelId
)
;
$subscriber
->
onGetConcatenatedScripts
(
$event
)
;
$actual
=
$event
->
getConcatenatedScripts
(
)
;
$expected
=
$scripts
. MockThemeCompilerConcatenatedSubscriber::SCRIPTS_CONCAT;
static
::
assertEquals
(
$expected
,
$actual
)
;
}
public
function
testCompileWithoutAssets
(
)
: void
{
$resolver
=
$this
->
createMock
(
ThemeFileResolver::
class
)
;
$resolver
->
method
(
'resolveFiles'
)
->
willReturn
(
[
ThemeFileResolver::SCRIPT_FILES =>
new
FileCollection
(
)
, ThemeFileResolver::STYLE_FILES =>
new
FileCollection
(
)
]
)
;