From 8b00368109a41b304c98498ccf635a314038feda Mon Sep 17 00:00:00 2001 From: Vincent Boon Date: Wed, 5 Feb 2025 09:14:03 +0100 Subject: [PATCH] Adjust test --- .../DeleteCurrentSpecialPricesTest.php | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/tests/Actions/Utility/DeleteCurrentSpecialPricesTest.php b/tests/Actions/Utility/DeleteCurrentSpecialPricesTest.php index 17511ca..3a36461 100644 --- a/tests/Actions/Utility/DeleteCurrentSpecialPricesTest.php +++ b/tests/Actions/Utility/DeleteCurrentSpecialPricesTest.php @@ -41,17 +41,19 @@ public function it_removes_special_prices(): void #[Test] public function it_removes_multiple_special_prices(): void { + $prices = [ + [ + 'sku' => '::sku_1::', + 'price' => 10, + ], + [ + 'sku' => '::sku_2::', + 'price' => 11, + ], + ]; + Http::fake([ - 'magento/rest/all/V1/products/special-price-information' => Http::response([ - [ - 'sku' => '::sku_1::', - 'price' => 10, - ], - [ - 'sku' => '::sku_2::', - 'price' => 11, - ], - ]), + 'magento/rest/all/V1/products/special-price-information' => Http::response($prices), 'magento/rest/all/V1/products/special-price-delete' => Http::response(), ])->preventStrayRequests(); @@ -61,7 +63,7 @@ public function it_removes_multiple_special_prices(): void Http::assertSentInOrder([ fn (Request $request): bool => $request->url() === 'magento/rest/all/V1/products/special-price-information', - fn (Request $request): bool => $request->url() === 'magento/rest/all/V1/products/special-price-delete' && $request->body() === '{"prices":[{"sku":"::sku_1::","price":10},{"sku":"::sku_2::","price":11}]}', + fn (Request $request): bool => $request->url() === 'magento/rest/all/V1/products/special-price-delete' && $request->data() === ['prices' => $prices], ]); }