static::
assertInstanceOf(MailTemplateEntity::
class,
$mailTemplate);
$criteria =
new Criteria([TestDefaults::SALES_CHANNEL
]);
$criteria->
setLimit(1
);
$salesChannel =
$this->
getContainer() ->
get('sales_channel.repository'
) ->
search($criteria,
$context) ->
first();
static::
assertInstanceOf(SalesChannelEntity::
class,
$salesChannel);
$entityEncoder =
new JsonEntityEncoder( new Serializer([new StructNormalizer()],
[new JsonEncoder()]) );
$orderDefinition =
$this->
getContainer()->
get(OrderDefinition::
class);
$orderDecode =
$entityEncoder->
encode(new Criteria(),
$orderDefinition,
$order, '/api'
);
array_walk_recursive($orderDecode,
static function D&
$value): void
{ if ($value instanceof \stdClass
) { $value =
json_decode((string) json_encode($value), true, 512, \JSON_THROW_ON_ERROR
);
} });
$salesChannelDefinition =
$this->
getContainer()->
get(SalesChannelDefinition::
class);
$salesChannelDecode =
$entityEncoder->
encode(new Criteria(),
$salesChannelDefinition,
$salesChannel, '/api'
);