protected function setUp(): void
{ $this->orderRepository =
$this->
getContainer()->
get('order.repository'
);
$this->context = Context::
createDefaultContext();
} public function testCustomFieldOrderVersioning(): void
{ $id = Uuid::
randomHex();
$versionId =
$this->context->
getVersionId();
$order =
$this->
getOrderFixture($id,
$versionId);
// create order + order version and belonging context
$this->orderRepository->
create([$order],
$this->context
);
$versionedOrderId =
$this->orderRepository->
createVersion($id,
$this->context
);
$versionedContext =
$this->context->
createWithVersionId($versionedOrderId);
/** @var OrderEntity $order */
$order =
$this->orderRepository->
search(new Criteria([$id]),
$this->context
)->
first();
/** @var OrderEntity $versionedOrder */
$versionedOrder =
$this->orderRepository->
search(new Criteria([$id]),
$versionedContext)->
first();