Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
deactivatePlugins example
'6.1.0'
)
;
$container
=
new
ContainerBuilder
(
)
;
$service
=
$this
->
createMock
(
Kernel::
class
)
;
$service
->
method
(
'getContainer'
)
->
willReturn
(
$container
)
;
$container
->
set
(
'kernel',
$service
)
;
$container
->
set
(
'event_dispatcher',
$eventDispatcher
)
;
$updateController
->
setContainer
(
$container
)
;
$updateController
->
deactivatePlugins
(
new
Request
(
)
, Context::
createDefaultContext
(
)
)
;
static
::
assertCount
(
2,
$events
)
;
static
::
assertInstanceOf
(
UpdatePrePrepareEvent::
class
,
$events
[
0
]
)
;
static
::
assertInstanceOf
(
UpdatePostPrepareEvent::
class
,
$events
[
1
]
)
;
}
public
function
testDeactivateMultipleExtensions
(
)
: void
{
$events
=
[
]
;
$eventDispatcher
=
$this
->
createMock
(
EventDispatcherInterface::
class
)
;