Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
assertScriptConditionFieldConfig example
static
::
assertEquals
(
'withRuleConditions',
$appEntity
->
getName
(
)
)
;
/** @var AppScriptConditionCollection $scriptCollection */
$scriptCollection
=
$appEntity
->
getScriptConditions
(
)
;
static
::
assertCount
(
14,
$scriptCollection
)
;
/** @var AppScriptConditionEntity $scriptCondition */
foreach
(
$scriptCollection
as
$scriptCondition
)
{
static
::
assertStringContainsString
(
'app\withRuleConditions_',
$scriptCondition
->
getIdentifier
(
)
)
;
static
::
assertStringContainsString
(
'{% return true %}',
(string)
$scriptCondition
->
getScript
(
)
)
;
static
::
assertIsArray
(
$scriptCondition
->
getConfig
(
)
)
;
$this
->
assertScriptConditionFieldConfig
(
$scriptCondition
)
;
}
$manifest
= Manifest::
createFromXmlFile
(
__DIR__ . '/_fixtures/withRuleConditionsUpdated/manifest.xml'
)
;
$this
->appLifecycle->
update
(
$manifest
,
[
'id' =>
$appEntity
->
getId
(
)
, 'roleId' => Uuid::
randomHex
(
)
]
,
$this
->context
)
;
/** @var AppCollection $apps */
$apps
=
$this
->appRepository->
search
(
$criteria
,
$this
->context
)
->
getEntities
(
)
;
/** @var AppEntity $appEntity */
$appEntity
=
$apps
->
first
(
)
;
static
::
assertNotNull
(
$appEntity
)
;