Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
fetchActiveTemplates example
$this
->
loadAppsFromDir
(
__DIR__ . '/../../Theme/fixtures/Apps/theme', false
)
;
$criteria
=
new
Criteria
(
)
;
$criteria
->
addFilter
(
new
EqualsFilter
(
'name', 'SwagTheme'
)
)
;
$appId
=
$this
->appRepo->
searchIds
(
$criteria
, Context::
createDefaultContext
(
)
)
->
firstId
(
)
;
static
::
assertNotNull
(
$appId
)
;
$this
->templateStateService->
activateAppTemplates
(
$appId
, Context::
createDefaultContext
(
)
)
;
$activeTemplates
=
$this
->
fetchActiveTemplates
(
$appId
)
;
static
::
assertCount
(
2,
$activeTemplates
)
;
}
public
function
testDeactivateApp
(
)
: void
{
$this
->
loadAppsFromDir
(
__DIR__ . '/../../Theme/fixtures/Apps/theme'
)
;
$criteria
=
new
Criteria
(
)
;
$criteria
->
addFilter
(
new
EqualsFilter
(
'name', 'SwagTheme'
)
)
;
$appId
=
$this
->appRepo->
searchIds
(
$criteria
, Context::
createDefaultContext
(
)
)
->
firstId
(
)
;