Skip to content

Commit 5eee59e

Browse files
Merge branch '8.5' into 9.5
2 parents 597cb64 + d44c478 commit 5eee59e

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

ChangeLog-8.5.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes of the PHPUnit 8.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
44

5+
## [8.5.24] - 2022-MM-DD
6+
7+
### Changed
8+
9+
* [#4874](https://github.com/sebastianbergmann/phpunit/pull/4874): `PHP_FLOAT_EPSILON` is now used instead of hardcoded `0.0000000001` in `PHPUnit\Framework\Constraint\IsIdentical`
10+
511
## [8.5.23] - 2022-01-21
612

713
### Fixed
@@ -197,6 +203,7 @@ All notable changes of the PHPUnit 8.5 release series are documented in this fil
197203
* [#3967](https://github.com/sebastianbergmann/phpunit/issues/3967): Cannot double interface that extends interface that extends `\Throwable`
198204
* [#3968](https://github.com/sebastianbergmann/phpunit/pull/3968): Test class run in a separate PHP process are passing when `exit` called inside
199205

206+
[8.5.24]: https://github.com/sebastianbergmann/phpunit/compare/8.5.23...8.5
200207
[8.5.23]: https://github.com/sebastianbergmann/phpunit/compare/8.5.22...8.5.23
201208
[8.5.22]: https://github.com/sebastianbergmann/phpunit/compare/8.5.21...8.5.22
202209
[8.5.21]: https://github.com/sebastianbergmann/phpunit/compare/8.5.20...8.5.21

src/Framework/Constraint/IsIdentical.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010
namespace PHPUnit\Framework\Constraint;
1111

12+
use const PHP_FLOAT_EPSILON;
1213
use function abs;
1314
use function get_class;
1415
use function is_array;
@@ -26,11 +27,6 @@
2627
*/
2728
final class IsIdentical extends Constraint
2829
{
29-
/**
30-
* @var float
31-
*/
32-
private const EPSILON = 0.0000000001;
33-
3430
/**
3531
* @var mixed
3632
*/
@@ -59,7 +55,7 @@ public function evaluate($other, string $description = '', bool $returnResult =
5955
if (is_float($this->value) && is_float($other) &&
6056
!is_infinite($this->value) && !is_infinite($other) &&
6157
!is_nan($this->value) && !is_nan($other)) {
62-
$success = abs($this->value - $other) < self::EPSILON;
58+
$success = abs($this->value - $other) < PHP_FLOAT_EPSILON;
6359
} else {
6460
$success = $this->value === $other;
6561
}

0 commit comments

Comments
 (0)