Tests: Minimize the chances of signature conflicts for assertEqualsWithDelta().

The PHPUnit 7.5+ method `assertEqualsWithDelta()` was polyfilled for PHPUnit < 7.5, but also overloaded for PHPUnit 7.5 itself, which was not necessary and created a higher chance of signature conflicts, especially when the WP test suite is used as a basis for integration tests with plugins/themes.

This change removes the unnecessary overloading for PHPUnit 7.5+ and simplifies the overloaded method for PHPUnit < 7.5, including removing the `IsEqual()` class alias declaration, no longer needed.

Follow-up to [48952].

Props jrf.
See #52625.

git-svn-id: https://develop.svn.wordpress.org/trunk@50986 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2021-05-25 01:07:43 +00:00
parent 94e04b7917
commit d80fdbca3b
4 changed files with 3 additions and 35 deletions

View File

@@ -30,11 +30,6 @@ class WP_UnitTestCase extends WP_UnitTestCase_Base {
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*/
public static function assertEqualsWithDelta( $expected, $actual, $delta, $message = '' ) {
$constraint = new PHPUnit_Framework_Constraint_IsEqual(
$expected,
$delta
);
static::assertThat( $actual, $constraint, $message );
static::assertEquals( $expected, $actual, $message, $delta );
}
}