Skip to content

Commit

Permalink
[CatalogPromotion] Fixes after rebasing with exclusive promotions fea…
Browse files Browse the repository at this point in the history
…ture
  • Loading branch information
GSadee committed Nov 25, 2021
1 parent 9287478 commit ea5c411
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ function it_applies_percentage_discount_on_product_variant(
}

function it_applies_discount_on_product_variant_only_if_exclusive_promotion_is_not_already_applied(
CatalogPromotionPriceCalculatorInterface $priceCalculator,
AppliedPromotionInformationFormatterInterface $appliedPromotionInformationFormatter,
ProductVariantInterface $variant,
CatalogPromotionInterface $catalogPromotion,
Expand All @@ -108,7 +109,6 @@ function it_applies_discount_on_product_variant_only_if_exclusive_promotion_is_n
$variant->getChannelPricingForChannel($secondChannel)->willReturn($secondChannelPricing);

$appliedPromotionInformationFormatter->format($catalogPromotion)->willReturn(['winter_sale' => ['name' => 'Winter sale']]);
$catalogPromotionAction->getConfiguration()->willReturn(['amount' => 0.3]);

$firstChannelPricing->hasExclusiveCatalogPromotionApplied()->willReturn(true);

Expand All @@ -119,6 +119,9 @@ function it_applies_discount_on_product_variant_only_if_exclusive_promotion_is_n
$secondChannelPricing->getOriginalPrice()->willReturn(null);
$secondChannelPricing->getMinimumPrice()->willReturn(0);
$secondChannelPricing->setOriginalPrice(1400)->shouldBeCalled();

$priceCalculator->calculate($secondChannelPricing, $catalogPromotionAction)->willReturn(980);

$secondChannelPricing->setPrice(980)->shouldBeCalled();
$secondChannelPricing->addAppliedPromotion(['winter_sale' => ['name' => 'Winter sale']])->shouldBeCalled();
$catalogPromotion->isExclusive()->willReturn(false);
Expand Down

0 comments on commit ea5c411

Please sign in to comment.