@@ -89,6 +89,7 @@ function it_applies_percentage_discount_on_product_variant(
8989 }
9090
9191 function it_applies_discount_on_product_variant_only_if_exclusive_promotion_is_not_already_applied (
92+ CatalogPromotionPriceCalculatorInterface $ priceCalculator ,
9293 AppliedPromotionInformationFormatterInterface $ appliedPromotionInformationFormatter ,
9394 ProductVariantInterface $ variant ,
9495 CatalogPromotionInterface $ catalogPromotion ,
@@ -108,7 +109,6 @@ function it_applies_discount_on_product_variant_only_if_exclusive_promotion_is_n
108109 $ variant ->getChannelPricingForChannel ($ secondChannel )->willReturn ($ secondChannelPricing );
109110
110111 $ appliedPromotionInformationFormatter ->format ($ catalogPromotion )->willReturn (['winter_sale ' => ['name ' => 'Winter sale ' ]]);
111- $ catalogPromotionAction ->getConfiguration ()->willReturn (['amount ' => 0.3 ]);
112112
113113 $ firstChannelPricing ->hasExclusiveCatalogPromotionApplied ()->willReturn (true );
114114
@@ -119,6 +119,9 @@ function it_applies_discount_on_product_variant_only_if_exclusive_promotion_is_n
119119 $ secondChannelPricing ->getOriginalPrice ()->willReturn (null );
120120 $ secondChannelPricing ->getMinimumPrice ()->willReturn (0 );
121121 $ secondChannelPricing ->setOriginalPrice (1400 )->shouldBeCalled ();
122+
123+ $ priceCalculator ->calculate ($ secondChannelPricing , $ catalogPromotionAction )->willReturn (980 );
124+
122125 $ secondChannelPricing ->setPrice (980 )->shouldBeCalled ();
123126 $ secondChannelPricing ->addAppliedPromotion (['winter_sale ' => ['name ' => 'Winter sale ' ]])->shouldBeCalled ();
124127 $ catalogPromotion ->isExclusive ()->willReturn (false );
0 commit comments