static::
assertCount(1,
$calculatedTaxForCustomItem);
$calculatedTaxForProductItem =
array_filter($calculatedTaxes,
fn ($tax) =>
$tax['taxRate'
] ===
$taxForProductItem);
static::
assertNotEmpty($calculatedTaxForProductItem);
static::
assertCount(1,
$calculatedTaxForProductItem);
} public function testDisableAutomaticPromotions(): void
{ $salesChannelContext =
$this->
createDefaultSalesChannelContext();
$this->
createTestFixtureFixedDiscountPromotion(Uuid::
randomHex(), 40, PromotionDiscountEntity::SCOPE_CART, null,
$this->
getContainer(),
$salesChannelContext);
$browser =
$this->
createCart(TestDefaults::SALES_CHANNEL,
$salesChannelContext->
getToken());
$productId = Uuid::
randomHex();
$this->
createTestFixtureProduct($productId, 119, 19,
$this->
getContainer(),
$salesChannelContext);
$this->
addProduct($browser, TestDefaults::SALES_CHANNEL,
$productId);
// There are 2 line items in cart including 1 product and 1 automatic promotion
$cart =
$this->
getCart($browser, TestDefaults::SALES_CHANNEL
);
static::
assertCount(2,
$cart['lineItems'
]);
static::
assertSame('product',
$cart['lineItems'
][0
]['type'
]);