Skip to content

Commit 5392e04

Browse files
committed
Fixed float comparison precision, because sebastianbergmann/comparator removed DoubleComparator
1 parent 766908f commit 5392e04

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/internal/Magento/Framework/Math/Test/Unit/DivisionTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,19 @@
1212

1313
class DivisionTest extends TestCase
1414
{
15+
/**
16+
* @var float
17+
*/
18+
private const EPSILON = 0.0000000001;
19+
1520
/**
1621
* @dataProvider getExactDivisionDataProvider
1722
*/
1823
public function testGetExactDivision($dividend, $divisor, $expected)
1924
{
2025
$mathDivision = new Division();
2126
$remainder = $mathDivision->getExactDivision($dividend, $divisor);
22-
$this->assertEquals($expected, $remainder);
27+
$this->assertEqualsWithDelta($expected, $remainder, self::EPSILON);
2328
}
2429

2530
/**

0 commit comments

Comments
 (0)