Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b02e251

Browse files
Peter Gribanovnicolas-grekas
Peter Gribanov
authored andcommitted
Correct compare float data
1 parent 9fd0eef commit b02e251

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Symfony/Component/Stopwatch/Tests/StopwatchPeriodTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function testGetEndTime($end, $useMorePrecision, $expected)
4040
public function testGetDuration($start, $end, $useMorePrecision, $duration)
4141
{
4242
$period = new StopwatchPeriod($start, $end, $useMorePrecision);
43-
$this->assertSame($duration, $period->getDuration());
43+
$this->assertEqualsWithDelta($duration, $period->getDuration(), \PHP_FLOAT_EPSILON);
4444
}
4545

4646
public function provideTimeValues()

src/Symfony/Component/Stopwatch/composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
"php": ">=7.1.3",
2020
"symfony/service-contracts": "^1.0|^2"
2121
},
22+
"require-dev": {
23+
"symfony/polyfill-php72": "~1.5"
24+
},
2225
"autoload": {
2326
"psr-4": { "Symfony\\Component\\Stopwatch\\": "" },
2427
"exclude-from-classmap": [

0 commit comments

Comments
 (0)