|
1 | 1 | <?php
|
2 |
| -/************************************************************************ |
3 |
| - * |
| 2 | +/** |
4 | 3 | * Copyright 2024 Adobe
|
5 | 4 | * All Rights Reserved.
|
6 |
| - * |
7 |
| - * NOTICE: All information contained herein is, and remains |
8 |
| - * the property of Adobe and its suppliers, if any. The intellectual |
9 |
| - * and technical concepts contained herein are proprietary to Adobe |
10 |
| - * and its suppliers and are protected by all applicable intellectual |
11 |
| - * property laws, including trade secret and copyright laws. |
12 |
| - * Dissemination of this information or reproduction of this material |
13 |
| - * is strictly forbidden unless prior written permission is obtained |
14 |
| - * from Adobe. |
15 |
| - * ************************************************************************ |
16 | 5 | */
|
17 | 6 | declare(strict_types=1);
|
18 | 7 |
|
@@ -113,11 +102,7 @@ public function testBundleProductFixedPriceWithOptionsWithoutPrices()
|
113 | 102 | $query = $this->getCartQuery($maskedQuoteId);
|
114 | 103 | $response = $this->graphQlQuery($query);
|
115 | 104 |
|
116 |
| - // price is the bundle product price as in this case the options don't have prices |
117 |
| - // specialPrice is the bundle product price * bundle product special price % |
118 |
| - // originalItemPriceProduct1 is the bundle product price |
119 |
| - // originalItemPriceProduct1 is with 10% discount as the special price |
120 |
| - $expectedResponse = $this->getExpectedResponse(15, 30, 30, 13.5, 27, 15, 13.5); |
| 105 | + $expectedResponse = $this->getExpectedResponse(15, 30, 30, 13.5, 27, 15, 15); |
121 | 106 |
|
122 | 107 | $this->assertEquals($expectedResponse, $response);
|
123 | 108 | }
|
@@ -185,11 +170,7 @@ public function testBundleProductFixedPriceWithOneOptionFixedPrice()
|
185 | 170 | $query = $this->getCartQuery($maskedQuoteId);
|
186 | 171 | $response = $this->graphQlQuery($query);
|
187 | 172 |
|
188 |
| - // price is the bundle product price + option fixed price |
189 |
| - // specialPrice is the bundle product price + option fixed price * bundle product special price % |
190 |
| - // originalItemPriceProduct1 is the bundle product price |
191 |
| - // originalItemPriceProduct1 is with 10% discount as the special price |
192 |
| - $expectedResponse = $this->getExpectedResponse(25, 50, 50, 22.5, 45, 25, 22.5); |
| 173 | + $expectedResponse = $this->getExpectedResponse(25, 50, 50, 22.5, 45, 25, 25); |
193 | 174 |
|
194 | 175 | $this->assertEquals($expectedResponse, $response);
|
195 | 176 | }
|
@@ -265,11 +246,7 @@ public function testBundleProductFixedPriceWithBothOptionsFixedPrice()
|
265 | 246 | $query = $this->getCartQuery($maskedQuoteId);
|
266 | 247 | $response = $this->graphQlQuery($query);
|
267 | 248 |
|
268 |
| - // price is the bundle product price + options fixed prices |
269 |
| - // specialPrice is the bundle product price + options fixed prices * bundle product special price % |
270 |
| - // originalItemPriceProduct1 is the bundle product price |
271 |
| - // originalItemPriceProduct1 is with 10% discount as the special price |
272 |
| - $expectedResponse = $this->getExpectedResponse(45, 90, 90, 40.50, 81, 45, 40.5); |
| 249 | + $expectedResponse = $this->getExpectedResponse(45, 90, 90, 40.50, 81, 45, 45); |
273 | 250 |
|
274 | 251 | $this->assertEquals($expectedResponse, $response);
|
275 | 252 | }
|
@@ -337,12 +314,7 @@ public function testBundleProductFixedPriceWithOneOptionPercentPrice()
|
337 | 314 | $query = $this->getCartQuery($maskedQuoteId);
|
338 | 315 | $response = $this->graphQlQuery($query);
|
339 | 316 |
|
340 |
| - // price is the (bundle product price * option percent price) + bundle product price |
341 |
| - // specialPrice is the (bundle product price * option percent price) + |
342 |
| - // bundle product price * bundle product special price % |
343 |
| - // originalItemPriceProduct1 is the bundle product price |
344 |
| - // originalItemPriceProduct1 is with 10% discount as the special price |
345 |
| - $expectedResponse = $this->getExpectedResponse(18, 36, 36, 16.20, 32.40, 18, 16.2); |
| 317 | + $expectedResponse = $this->getExpectedResponse(18, 36, 36, 16.20, 32.40, 18, 18); |
346 | 318 |
|
347 | 319 | $this->assertEquals($expectedResponse, $response);
|
348 | 320 | }
|
@@ -418,12 +390,7 @@ public function testBundleProductFixedPriceWithBothOptionsPercentPrices()
|
418 | 390 | $query = $this->getCartQuery($maskedQuoteId);
|
419 | 391 | $response = $this->graphQlQuery($query);
|
420 | 392 |
|
421 |
| - // price is the (bundle product price * options percent price) + bundle product price |
422 |
| - // specialPrice is the (bundle product price * options percent price) + |
423 |
| - // bundle product price * bundle product special price % |
424 |
| - // originalItemPriceProduct1 is the bundle product price |
425 |
| - // originalItemPriceProduct1 is with 10% discount as the special price |
426 |
| - $expectedResponse = $this->getExpectedResponse(19.5, 39, 39, 17.55, 35.10, 19.5, 17.55); |
| 393 | + $expectedResponse = $this->getExpectedResponse(19.5, 39, 39, 17.55, 35.10, 19.5, 19.5); |
427 | 394 |
|
428 | 395 | $this->assertEquals($expectedResponse, $response);
|
429 | 396 | }
|
@@ -499,12 +466,7 @@ public function testBundleProductFixedPriceWithOneOptionFixedAndOnePercentPrice(
|
499 | 466 | $query = $this->getCartQuery($maskedQuoteId);
|
500 | 467 | $response = $this->graphQlQuery($query);
|
501 | 468 |
|
502 |
| - // price is the (bundle product price * option percent price) + bundle product price + option fixed price |
503 |
| - // specialPrice is the (bundle product price * option percent price) + bundle product price + |
504 |
| - // option fixed price * bundle product special price % |
505 |
| - // originalItemPriceProduct1 is the bundle product price |
506 |
| - // originalItemPriceProduct1 is with 10% discount as the special price |
507 |
| - $expectedResponse = $this->getExpectedResponse(28, 56, 56, 25.20, 50.40, 28, 25.2); |
| 469 | + $expectedResponse = $this->getExpectedResponse(28, 56, 56, 25.20, 50.40, 28, 28); |
508 | 470 |
|
509 | 471 | $this->assertEquals($expectedResponse, $response);
|
510 | 472 | }
|
@@ -623,7 +585,7 @@ public function testBundleProductDynamicPriceWithSpecialPrice()
|
623 | 585 | "currency" => "USD"
|
624 | 586 | ],
|
625 | 587 | "original_item_price" => [
|
626 |
| - "value" => 25, // product 1 special_price(15) + product 2 price (10) |
| 588 | + "value" => 30, // product 1 price(20) + product 2 price (10) |
627 | 589 | "currency" => "USD"
|
628 | 590 | ]
|
629 | 591 | ]
|
|
0 commit comments