$this->
setNewShippingPrices($this->connection, 100
);
$code = 'BF';
// add a new sample product
$this->
createTestFixtureProduct($productId, 60, 17,
$this->
getContainer(),
$this->context
);
// add a new promotion black friday
$this->
createTestFixtureDeliveryPromotion($promotionId, PromotionDiscountEntity::TYPE_ABSOLUTE, 40,
$this->
getContainer(),
$this->context,
$code);
$this->
createTestFixtureDiscount($promotionId, PromotionDiscountEntity::TYPE_PERCENTAGE, PromotionDiscountEntity::SCOPE_DELIVERY, 20, null,
$this->
getContainer(),
$this->context
);
$this->
createTestFixtureDiscount($promotionId, PromotionDiscountEntity::TYPE_FIXED_UNIT, PromotionDiscountEntity::SCOPE_DELIVERY, 69, null,
$this->
getContainer(),
$this->context
);
$cart =
$this->cartService->
getCart($this->token,
$this->context
);
// create product and add to cart
$cart =
$this->
addProduct($productId, 2,
$cart,
$this->cartService,
$this->context
);
static::
assertEquals(100,
$cart->
getShippingCosts()->
getTotalPrice(), 'Delivery costs should be 100 in the beginning'
);
static::
assertEquals(1,
$cart->
getLineItems()->
count());