Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b02e251

Browse filesBrowse files
Peter Gribanovnicolas-grekas
Peter Gribanov
authored andcommitted
Correct compare float data
1 parent 9fd0eef commit b02e251
Copy full SHA for b02e251

File tree

2 files changed

+4
-1
lines changed
Filter options

2 files changed

+4
-1
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Stopwatch/Tests/StopwatchPeriodTest.php
+1-1Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Stopwatch/composer.json
+3Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.