diff --git a/src/Symfony/Component/Stopwatch/Tests/StopwatchPeriodTest.php b/src/Symfony/Component/Stopwatch/Tests/StopwatchPeriodTest.php index e01849d474869..81010a79413fd 100644 --- a/src/Symfony/Component/Stopwatch/Tests/StopwatchPeriodTest.php +++ b/src/Symfony/Component/Stopwatch/Tests/StopwatchPeriodTest.php @@ -40,7 +40,7 @@ public function testGetEndTime($end, $useMorePrecision, $expected) public function testGetDuration($start, $end, $useMorePrecision, $duration) { $period = new StopwatchPeriod($start, $end, $useMorePrecision); - $this->assertSame($duration, $period->getDuration()); + $this->assertEqualsWithDelta($duration, $period->getDuration(), \PHP_FLOAT_EPSILON); } public function provideTimeValues() diff --git a/src/Symfony/Component/Stopwatch/composer.json b/src/Symfony/Component/Stopwatch/composer.json index 1babf15aed09f..a11dc7960f185 100644 --- a/src/Symfony/Component/Stopwatch/composer.json +++ b/src/Symfony/Component/Stopwatch/composer.json @@ -19,6 +19,9 @@ "php": ">=7.1.3", "symfony/service-contracts": "^1.0|^2" }, + "require-dev": { + "symfony/polyfill-php72": "~1.5" + }, "autoload": { "psr-4": { "Symfony\\Component\\Stopwatch\\": "" }, "exclude-from-classmap": [