Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setIconRaw example
$idFlowAction
= Uuid::
randomHex
(
)
;
$appFlowAction
=
new
AppFlowActionEntity
(
)
;
$appFlowAction
->
setId
(
$idFlowAction
)
;
$iconPath
= __DIR__ . '/../../Manifest/_fixtures/icon.png';
$fileIcon
= '';
if
(
file_exists
(
$iconPath
)
)
{
$fileIcon
= \
file_get_contents
(
$iconPath
)
;
}
$appFlowAction
->
setIconRaw
(
$fileIcon
!== false ?
$fileIcon
: null
)
;
$subscriber
=
new
AppFlowActionLoadedSubscriber
(
)
;
$event
=
new
EntityLoadedEvent
(
new
AppFlowActionDefinition
(
)
,
[
$appFlowAction
]
, Context::
createDefaultContext
(
)
)
;
$subscriber
->
unserialize
(
$event
)
;
static
::
assertNotFalse
(
$fileIcon
)
;
static
::
assertEquals
(
base64_encode
(
$fileIcon
)
,
$appFlowAction
->
getIcon
(
)
)
;
}