Skip to content

Commit ba2c3bb

Browse files
committed
AC-7549:: 2.4.6 alpha 2 Composer Build Failures - GraphQL
1 parent 913cbf9 commit ba2c3bb

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/CartPromotionsTest.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ class CartPromotionsTest extends GraphQlAbstract
2929
* @magentoApiDataFixture Magento/Catalog/_files/multiple_products.php
3030
* @magentoApiDataFixture Magento/SalesRule/_files/rules_category.php
3131
*/
32+
33+
/**
34+
* @var float
35+
*/
36+
private const EPSILON = 0.0000000001;
37+
3238
public function testCartPromotionSingleCartRule()
3339
{
3440
$skus =['simple1', 'simple2'];
@@ -151,16 +157,18 @@ public function testCartPromotionsMultipleCartRules()
151157
$lineItemDiscount = $productsInResponse[$itemIndex][0]['prices']['discounts'];
152158
$expectedTotalDiscountValue = ($productsInCart[$itemIndex]->getSpecialPrice()*$qty*0.5) +
153159
($productsInCart[$itemIndex]->getSpecialPrice()*$qty*0.5*0.1);
154-
$this->assertEquals(
160+
$this->assertEqualsWithDelta(
155161
$productsInCart[$itemIndex]->getSpecialPrice()*$qty*0.5,
156-
current($lineItemDiscount)['amount']['value']
162+
current($lineItemDiscount)['amount']['value'],
163+
self::EPSILON
157164
);
158165
$this->assertEquals('TestRule_Label', current($lineItemDiscount)['label']);
159166

160167
$lineItemDiscountValue = next($lineItemDiscount)['amount']['value'];
161-
$this->assertEquals(
168+
$this->assertEqualsWithDelta(
162169
round($productsInCart[$itemIndex]->getSpecialPrice()*$qty*0.5)*0.1,
163-
$lineItemDiscountValue
170+
$lineItemDiscountValue,
171+
self::EPSILON
164172
);
165173
$this->assertEquals('10% off with two items_Label', end($lineItemDiscount)['label']);
166174
$actualTotalDiscountValue = $lineItemDiscount[0]['amount']['value']+$lineItemDiscount[1]['amount']['value'];

0 commit comments

Comments
 (0)