Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
FakeKernelPluginLoader example
$this
->cacheItemPoolInterfaceMock->
method
(
'getItem'
)
->
willReturn
(
new
CacheItem
(
)
)
;
$kernelMock
=
$this
->
createMock
(
Kernel::
class
)
;
$containerMock
=
$this
->
createMock
(
Container::
class
)
;
$containerMock
->
method
(
'getParameter'
)
->
with
(
'kernel.plugin_dir'
)
->
willReturn
(
'tmp'
)
;
$containerMock
->
method
(
'get'
)
->
willReturn
(
$this
->eventDispatcher
)
;
$kernelMock
->
method
(
'getContainer'
)
->
willReturn
(
$containerMock
)
;
$this
->containerMock
->
expects
(
static
::
exactly
(
2
)
)
->
method
(
'get'
)
->
willReturnOnConsecutiveCalls
(
$kernelMock
,
new
FakeKernelPluginLoader
(
[
[
'baseClass' => 'MockPlugin',
'active' => false,
]
,
]
)
)
;
$this
->pluginLifecycleService->
activatePlugin
(
$pluginEntityMock
,
$context
)
;
}