Skip to content

Commit

Permalink
Adjust test
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentBean committed Feb 5, 2025
1 parent 89f8efd commit 8b00368
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions tests/Actions/Utility/DeleteCurrentSpecialPricesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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],
]);
}

Expand Down

0 comments on commit 8b00368

Please sign in to comment.