public function testUpdateOrder(): void
{ $ids =
new IdsCollection();
$order =
[ 'id' =>
$ids->
get('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
),
'billingAddressId' =>
$ids->
get('billing'
),
'currencyId' => Defaults::CURRENCY,
'salesChannelId' => TestDefaults::SALES_CHANNEL,
'stateId' =>
$this->
getStateId(),
'currencyFactor' => 1,
'orderDateTime' =>
new \
DateTime(),
'price' =>
json_decode(json_encode(new CartPrice(1, 1, 1,
new CalculatedTaxCollection(),
new TaxRuleCollection(), CartPrice::TAX_STATE_FREE
), \JSON_THROW_ON_ERROR
), true, 512, \JSON_THROW_ON_ERROR
),
'shippingCosts' =>
json_decode(json_encode(new CalculatedPrice(1, 1,
new CalculatedTaxCollection(),
new TaxRuleCollection()), \JSON_THROW_ON_ERROR
), true, 512, \JSON_THROW_ON_ERROR
),
];
$this->
getContainer()->
get('order.repository'
) ->
create([$order], Context::
createDefaultContext());
$this->
getContainer()->
get(Connection::
class) ->
executeStatement('UPDATE `order` SET total_rounding = NULL WHERE id = :id',
['id' =>
$ids->
getBytes('order'
)]);