@@ -34,6 +34,34 @@ protected function setUp(): void
34
34
$ this ->getCustomerAuthenticationHeader = $ this ->objectManager ->get (GetCustomerAuthenticationHeader::class);
35
35
}
36
36
37
+ /**
38
+ * @magentoApiDataFixture Magento/Store/_files/second_website_with_two_stores.php
39
+ * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable_in_multiple_websites.php
40
+ * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable_in_multiple_websites_with_special_price.php
41
+ */
42
+ public function testMinimalPriceForConfigurableProductWithSpecialPrice () : void
43
+ {
44
+ $ headerMapFirstStore ['Store ' ] = 'default ' ;
45
+ $ headerMapSecondStore ['Store ' ] = 'fixture_second_store ' ;
46
+ $ query = $ this ->getProductsBySkuQuery ();
47
+ $ responseForFirstWebsite = $ this ->graphQlQuery ($ query , [], '' , $ headerMapFirstStore );
48
+ $ responseForSecondWebsite = $ this ->graphQlQuery ($ query , [], '' , $ headerMapSecondStore );
49
+
50
+ $ this ->assertNotEmpty ($ responseForFirstWebsite ['products ' ]);
51
+ $ priceRange = $ responseForFirstWebsite ['products ' ]['items ' ][0 ]['price_range ' ];
52
+ $ this ->assertEquals (10 , $ priceRange ['minimum_price ' ]['regular_price ' ]['value ' ]);
53
+ $ this ->assertEquals (10 , $ priceRange ['minimum_price ' ]['final_price ' ]['value ' ]);
54
+ $ this ->assertEquals (10 , $ priceRange ['maximum_price ' ]['regular_price ' ]['value ' ]);
55
+ $ this ->assertEquals (10 , $ priceRange ['maximum_price ' ]['final_price ' ]['value ' ]);
56
+
57
+ $ this ->assertNotEmpty ($ responseForSecondWebsite ['products ' ]);
58
+ $ priceRange = $ responseForSecondWebsite ['products ' ]['items ' ][0 ]['price_range ' ];
59
+ $ this ->assertEquals (20 , $ priceRange ['minimum_price ' ]['regular_price ' ]['value ' ]);
60
+ $ this ->assertEquals (4 , $ priceRange ['minimum_price ' ]['final_price ' ]['value ' ]);
61
+ $ this ->assertEquals (20 , $ priceRange ['maximum_price ' ]['regular_price ' ]['value ' ]);
62
+ $ this ->assertEquals (4 , $ priceRange ['maximum_price ' ]['final_price ' ]['value ' ]);
63
+ }
64
+
37
65
/**
38
66
* Test for checking if catalog rule price has been applied for all customer group
39
67
*
@@ -281,26 +309,6 @@ private function getProductSearchQuery(string $productSku): string
281
309
QUERY ;
282
310
}
283
311
284
- /**
285
- * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable_in_multiple_websites_with_special_price.php
286
- */
287
- public function testMinimalPriceForConfigurableProductWithSpecialPrice () : void
288
- {
289
- $ query = $ this ->getProductsBySkuQuery ();
290
- $ response = $ this ->graphQlQuery (
291
- $ query ,
292
- [],
293
- '' ,
294
- $ this ->getCustomerAuthenticationHeader ->execute ('customer@example.com ' , 'password ' )
295
- );
296
- $ this ->assertNotEmpty ($ response ['products ' ]);
297
- $ priceRange = $ response ['products ' ]['items ' ][0 ]['price_range ' ];
298
- $ this ->assertEquals (10 , $ priceRange ['minimum_price ' ]['regular_price ' ]['value ' ]);
299
- $ this ->assertEquals (10 , $ priceRange ['minimum_price ' ]['final_price ' ]['value ' ]);
300
- $ this ->assertEquals (10 , $ priceRange ['maximum_price ' ]['regular_price ' ]['value ' ]);
301
- $ this ->assertEquals (10 , $ priceRange ['maximum_price ' ]['final_price ' ]['value ' ]);
302
- }
303
-
304
312
/**
305
313
* Get a query which user filter for product sku and returns price_range
306
314
*
0 commit comments