$this->salesChannelContext =
$this->
getContainer()->
get(SalesChannelContextFactory::
class)->
create( Uuid::
randomHex(),
TestDefaults::SALES_CHANNEL,
[ SalesChannelContextService::CUSTOMER_ID =>
$customerId,
SalesChannelContextService::SHIPPING_METHOD_ID =>
$shippingMethod->
getId(),
SalesChannelContextService::PAYMENT_METHOD_ID =>
$paymentMethod->
getId(),
] );
$ruleIds =
[$shippingMethod->
getAvailabilityRuleId()];
if ($paymentRuleId =
$paymentMethod->
getAvailabilityRuleId()) { $ruleIds[] =
$paymentRuleId;
} $this->salesChannelContext->
setRuleIds($ruleIds);
} public function testMigrationWorks(): void
{ $cart =
$this->
generateDemoCart(2
);
$orderId =
$this->
persistCart($cart);