$this->
addProduct($browser, TestDefaults::SALES_CHANNEL,
$productId);
// Save promotion to database
$this->
createTestFixturePercentagePromotion(Uuid::
randomHex(),
$promotionCode, 100, null,
$this->
getContainer());
// Add promotion code to our cart (not existing in DB)
$this->
addPromotionCodeByAPI($browser, TestDefaults::SALES_CHANNEL,
$promotionCode);
$cart =
$this->
getCart($browser, TestDefaults::SALES_CHANNEL
);
$this->
updateLineItemQuantity($browser, TestDefaults::SALES_CHANNEL,
$cart['lineItems'
][0
]['id'
], 3
);
$cart =
$this->
getCart($browser, TestDefaults::SALES_CHANNEL
);
static::
assertCount(2,
$cart['lineItems'
]);
} public function testSwitchCustomerWithoutSalesChannelId(): void
{ $salesChannelContextFactory =
$this->
getContainer()->
get(SalesChannelContextFactory::
class);
$salesChannelContext =
$salesChannelContextFactory->
create(Uuid::
randomHex(), TestDefaults::SALES_CHANNEL
);
$customerId =
$this->
createCustomer($salesChannelContext, 'info@example.com'
);