$this->eventDispatcher->
addListener(SalesChannelContextRestorerOrderCriteriaEvent::
class,
$this->callbackFn
);
$this->contextRestorer->
restoreByOrder($ids->
create('order'
),
$context);
static::
assertArrayHasKey(SalesChannelContextRestorerOrderCriteriaEvent::
class,
$this->events
);
$salesChannelContextRestorerCriteriaEvent =
$this->events
[SalesChannelContextRestorerOrderCriteriaEvent::
class];
static::
assertInstanceOf(SalesChannelContextRestorerOrderCriteriaEvent::
class,
$salesChannelContextRestorerCriteriaEvent);
} private function createOrder(TestDataCollection
$ids): void
{ $customer =
(new CustomerBuilder($ids, '10000'
)) ->
add('guest', true
) ->
add('createdAt',
new \
DateTime('- 25 hours'
))->
build();
$data =
[ 'id' =>
$ids->
create('order'
),
'itemRounding' =>
json_decode(json_encode(new CashRoundingConfig(2, 0.01, true
), \JSON_THROW_ON_ERROR
), true, 512, \JSON_THROW_ON_ERROR
),
'totalRounding' =>
json_decode(json_encode(new CashRoundingConfig(2, 0.01, true
), \JSON_THROW_ON_ERROR
), true, 512, \JSON_THROW_ON_ERROR
),
'orderNumber' => Uuid::
randomHex(),
'billingAddressId' =>
$ids->
create('billing-address'
),
'currencyId' => Defaults::CURRENCY,
'languageId' => Defaults::LANGUAGE_SYSTEM,