Skip to content

Commit c3751b3

Browse files
committed
Update promotions applicator to use product instead of promo IDs
This change modifies the test cases to pass the product object directly to the `apply` method of `RuntimePromotionsApplicator` instead of an array of promotion identifiers. It ensures consistency with the expected method signature and aligns the tests with the updated behavior.
1 parent 686780e commit c3751b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/Calculator/ProductVariantPricesCalculatorTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function it_calculates_catalog_promotion(): void
6969
$productVariant->getProduct()->willReturn($product->reveal());
7070

7171
$runtimePromotionsApplicator = $this->prophesize(RuntimePromotionsApplicatorInterface::class);
72-
$runtimePromotionsApplicator->apply(['promo1', 'promo2'], 800, true)->willReturn(600);
72+
$runtimePromotionsApplicator->apply($product->reveal(), 800, true)->willReturn(600);
7373

7474
$calculator = new ProductVariantPricesCalculator($runtimePromotionsApplicator->reveal());
7575

@@ -103,7 +103,7 @@ public function it_respects_minimum_price(): void
103103
$productVariant->getProduct()->willReturn($product->reveal());
104104

105105
$runtimePromotionsApplicator = $this->prophesize(RuntimePromotionsApplicatorInterface::class);
106-
$runtimePromotionsApplicator->apply(['promo1'], 800, false)->willReturn(600);
106+
$runtimePromotionsApplicator->apply($product->reveal(), 800, false)->willReturn(600);
107107

108108
$calculator = new ProductVariantPricesCalculator($runtimePromotionsApplicator->reveal());
109109

0 commit comments

Comments
 (0)