Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
HelperSet example
$pluginService
->
expects
(
static
::
once
(
)
)
->
method
(
'refreshPlugins'
)
;
$pluginRepository
=
new
StaticEntityRepository
(
[
new
PluginCollection
(
[
$this
->
createPlugin
(
'Test'
)
,
$this
->
createPlugin
(
'Test2'
)
,
]
)
]
)
;
$pluginLifecycleService
=
$this
->
createMock
(
PluginLifecycleService::
class
)
;
$pluginLifecycleService
->
expects
(
static
::
never
(
)
)
->
method
(
'updatePlugin'
)
;
$command
=
new
PluginUpdateAllCommand
(
$pluginService
,
$pluginRepository
,
$pluginLifecycleService
)
;
$command
->
setHelperSet
(
new
HelperSet
(
)
)
;
$tester
=
new
CommandTester
(
$command
)
;
static
::
assertSame
(
Command::SUCCESS,
$tester
->
execute
(
[
]
)
)
;
}
public
function
testUpdatableButNotActive
(
)
: void
{
$pluginService
=
$this
->
createMock
(
PluginService::
class
)
;
$pluginService
->
expects
(
static
::
once
(
)
)
->
method
(
'refreshPlugins'
)
;
$pluginRepository
=
new
StaticEntityRepository
(
[
new
PluginCollection
(
[