->
willReturnCallback(function Darray
$data, Context
$context) use ($orderEntity) { static::
assertSame($data[0
]['stateId'
],
$orderEntity->
getStateId());
static::
assertNotNull($data[0
]['deliveries'
]);
static::
assertNotNull($data[0
]['deliveries'
][0
]);
static::
assertSame($data[0
]['deliveries'
][0
]['stateId'
],
$orderEntity->
getDeliveries()?->
first()?->
getStateId());
static::
assertSame($context->
getTaxState(), CartPrice::TAX_STATE_FREE
);
/** @var CartPrice $price */
$price =
$data[0
]['price'
];
static::
assertSame($price->
getTaxStatus(), CartPrice::TAX_STATE_FREE
);
return new EntityWrittenContainerEvent(Context::
createDefaultContext(),
new NestedEventCollection([ new EntityWrittenEvent('order',
[new EntityWriteResult('created-id',
[], 'order', EntityWriteResult::OPERATION_INSERT
)], Context::
createDefaultContext()),
]),
[]);
});
$this->orderConverter
->
expects(static::
once()) ->
method('assembleSalesChannelContext'
) ->
willReturnCallback(function DOrderEntity
$order, Context
$context) { $context->
setTaxState($order->
getTaxStatus());