Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
UninstallAppsStrategy example
$themeLifecycleHandler
= null;
if
(
class_exists
(
ThemeAppLifecycleHandler::
class
)
)
{
$themeLifecycleHandler
=
$this
->
createMock
(
ThemeAppLifecycleHandler::
class
)
;
$themeLifecycleHandler
->
expects
(
static
::
once
(
)
)
->
method
(
'handleUninstall'
)
->
with
(
static
::
callback
(
fn
(
AppDeactivatedEvent
$event
)
=>
$event
->
getApp
(
)
->
getName
(
)
===
$app
->
getName
(
)
)
)
;
}
$uninstallAppsResolver
=
new
UninstallAppsStrategy
(
$this
->
getContainer
(
)
->
get
(
'app.repository'
)
,
$this
->systemConfigService,
$themeLifecycleHandler
)
;
$uninstallAppsResolver
->
resolve
(
$this
->context
)
;
static
::
assertNotEquals
(
$shopId
,
$this
->shopIdProvider->
getShopId
(
)
)
;
static
::
assertNull
(
$this
->
getInstalledApp
(
$this
->context
)
)
;
}