Skip to content

Commit 580f5b8

Browse files
committed
Merge remote-tracking branch 'origin/AC-7681-v3' into Hammer_Release_Regression_Issues_29Jan22
2 parents c213a03 + d023f7b commit 580f5b8

File tree

4 files changed

+29
-14
lines changed

4 files changed

+29
-14
lines changed

dev/tests/integration/testsuite/Magento/SalesRule/Model/Rule/Action/Discount/CartFixedTest.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@
4747
*/
4848
class CartFixedTest extends TestCase
4949
{
50+
/**
51+
* @var float
52+
*/
53+
private const EPSILON = 0.0000000001;
54+
5055
/**
5156
* @var GuestCartManagementInterface
5257
*/
@@ -521,11 +526,11 @@ public function testDiscountsWhenByPercentRuleAppliedFirstAndCartFixedRuleSecond
521526
$item = array_shift($items);
522527
$this->assertEquals('simple1', $item->getSku());
523528
$this->assertEquals(5.99, $item->getPrice());
524-
$this->assertEquals($expectedDiscounts[$item->getSku()], $item->getDiscountAmount());
529+
$this->assertEqualsWithDelta($expectedDiscounts[$item->getSku()], $item->getDiscountAmount(), self::EPSILON);
525530
$item = array_shift($items);
526531
$this->assertEquals('simple2', $item->getSku());
527532
$this->assertEquals(15.99, $item->getPrice());
528-
$this->assertEquals($expectedDiscounts[$item->getSku()], $item->getDiscountAmount());
533+
$this->assertEqualsWithDelta($expectedDiscounts[$item->getSku()], $item->getDiscountAmount(), self::EPSILON);
529534
}
530535

531536
public function discountByPercentDataProvider()

dev/tests/integration/testsuite/Magento/Tax/Model/Sales/Total/Quote/TaxTest.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
*/
2424
class TaxTest extends \Magento\TestFramework\Indexer\TestCase
2525
{
26+
/**
27+
* @var float
28+
*/
29+
private const EPSILON = 0.0000000001;
30+
2631
/**
2732
* Utility object for setting up tax rates, tax classes and tax rules
2833
*
@@ -176,7 +181,7 @@ public function testFullDiscountWithDeltaRoundingFix()
176181
protected function verifyItem($item, $expectedItemData)
177182
{
178183
foreach ($expectedItemData as $key => $value) {
179-
$this->assertEquals($value, $item->getData($key), 'item ' . $key . ' is incorrect');
184+
$this->assertEqualsWithDelta($value, $item->getData($key), self::EPSILON, 'item ' . $key . ' is incorrect');
180185
}
181186

182187
return $this;
@@ -247,7 +252,12 @@ protected function verifyQuoteAddress($quoteAddress, $expectedAddressData)
247252
if ($key == 'applied_taxes') {
248253
$this->verifyAppliedTaxes($quoteAddress->getAppliedTaxes(), $value);
249254
} else {
250-
$this->assertEquals($value, $quoteAddress->getData($key), 'Quote address ' . $key . ' is incorrect');
255+
$this->assertEqualsWithDelta(
256+
$value,
257+
$quoteAddress->getData($key),
258+
self::EPSILON,
259+
'Quote address ' . $key . ' is incorrect'
260+
);
251261
}
252262
}
253263

dev/tests/integration/testsuite/Magento/Tax/Model/TaxCalculationTest.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@
1616
class TaxCalculationTest extends \PHPUnit\Framework\TestCase
1717
{
1818
/**
19-
* Object Manager
20-
*
19+
* @var float
20+
*/
21+
private const EPSILON = 0.0000000001;
22+
23+
/**
2124
* @var \Magento\Framework\ObjectManagerInterface
2225
*/
2326
private $objectManager;
2427

2528
/**
26-
* Tax calculation service
27-
*
2829
* @var \Magento\Tax\Api\TaxCalculationInterface
2930
*/
3031
private $taxCalculationService;
@@ -108,7 +109,7 @@ public function testCalculateTaxUnitBased($quoteDetailsData, $expected)
108109
);
109110

110111
$taxDetails = $this->taxCalculationService->calculateTax($quoteDetails, 1);
111-
$this->assertEquals($expected, $this->convertObjectToArray($taxDetails));
112+
$this->assertEqualsWithDelta($expected, $this->convertObjectToArray($taxDetails), self::EPSILON);
112113
}
113114

114115
/**
@@ -1286,7 +1287,7 @@ public function testCalculateTaxRowBased($quoteDetailsData, $expectedTaxDetails)
12861287

12871288
$taxDetails = $this->taxCalculationService->calculateTax($quoteDetails);
12881289

1289-
$this->assertEquals($expectedTaxDetails, $this->convertObjectToArray($taxDetails));
1290+
$this->assertEqualsWithDelta($expectedTaxDetails, $this->convertObjectToArray($taxDetails), self::EPSILON);
12901291
}
12911292

12921293
/**
@@ -2387,7 +2388,7 @@ public function testMultiRulesRowBased($quoteDetailsData, $expectedTaxDetails)
23872388

23882389
$taxDetails = $this->taxCalculationService->calculateTax($quoteDetails);
23892390

2390-
$this->assertEquals($expectedTaxDetails, $this->convertObjectToArray($taxDetails));
2391+
$this->assertEqualsWithDelta($expectedTaxDetails, $this->convertObjectToArray($taxDetails), self::EPSILON);
23912392
}
23922393

23932394
/**
@@ -2424,7 +2425,7 @@ public function testMultiRulesTotalBased($quoteDetailsData, $expectedTaxDetails)
24242425

24252426
$taxDetails = $this->taxCalculationService->calculateTax($quoteDetails);
24262427

2427-
$this->assertEquals($expectedTaxDetails, $this->convertObjectToArray($taxDetails));
2428+
$this->assertEqualsWithDelta($expectedTaxDetails, $this->convertObjectToArray($taxDetails), self::EPSILON);
24282429
}
24292430

24302431
/**
@@ -2471,7 +2472,7 @@ public function testMultiRulesUnitBased($quoteDetailsData, $expectedTaxDetails)
24712472

24722473
$taxDetails = $this->taxCalculationService->calculateTax($quoteDetails);
24732474

2474-
$this->assertEquals($expectedTaxDetails, $this->convertObjectToArray($taxDetails));
2475+
$this->assertEqualsWithDelta($expectedTaxDetails, $this->convertObjectToArray($taxDetails), self::EPSILON);
24752476
}
24762477

24772478
/**

lib/web/fotorama/fotorama.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,6 @@ fotoramaVersion = '4.6.4';
12191219
}
12201220

12211221
function stopEvent(e, stopPropagation) {
1222-
e.preventDefault ? e.preventDefault() : (e.returnValue = false);
12231222
stopPropagation && e.stopPropagation && e.stopPropagation();
12241223
}
12251224

0 commit comments

Comments
 (0)