Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
MailTemplateMediaCollection example
$mediaA
=
new
MailTemplateMediaEntity
(
)
;
$mediaA
->
setId
(
Uuid::
randomHex
(
)
)
;
$mediaA
->
setMedia
(
new
MediaEntity
(
)
)
;
$mediaA
->
setLanguageId
(
$context
->
getLanguageId
(
)
)
;
$mediaB
=
new
MailTemplateMediaEntity
(
)
;
$mediaB
->
setId
(
Uuid::
randomHex
(
)
)
;
$mediaC
=
new
MailTemplateMediaEntity
(
)
;
$mediaC
->
setId
(
Uuid::
randomHex
(
)
)
;
$mediaC
->
setMedia
(
new
MediaEntity
(
)
)
;
$mediaC
->
setLanguageId
(
$context
->
getLanguageId
(
)
)
;
$mailTemplate
->
setMedia
(
new
MailTemplateMediaCollection
(
[
$mediaA
,
$mediaB
,
$mediaC
]
)
)
;
$this
->mediaService
->
expects
(
static
::
exactly
(
2
)
)
->
method
(
'getAttachment'
)
->
willReturnOnConsecutiveCalls
(
[
'content' => 'foo',
'fileName' => 'foo',
'mimeType' => 'foo',
]
,
[