From 008efa231beafd7ce4865dc687c4a26e58e510de Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Thu, 21 Nov 2019 09:29:03 +0100 Subject: [PATCH] Closes #3342 --- src/Framework/Assert.php | 65 ++++++++-------------------------------- 1 file changed, 12 insertions(+), 53 deletions(-) diff --git a/src/Framework/Assert.php b/src/Framework/Assert.php index 3b109cd562b..b187e8dc4aa 100644 --- a/src/Framework/Assert.php +++ b/src/Framework/Assert.php @@ -415,32 +415,14 @@ public static function assertNotCount(int $expectedCount, $haystack, string $mes * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ - public static function assertEquals($expected, $actual, string $message = '', float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false): void + public static function assertEquals($expected, $actual, string $message = ''): void { - // @codeCoverageIgnoreStart - if ($delta !== 0.0) { - self::createWarning('The optional $delta parameter of assertEquals() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertEqualsWithDelta() instead.'); - } - - if ($maxDepth !== 10) { - self::createWarning('The optional $maxDepth parameter of assertEquals() is deprecated and will be removed in PHPUnit 9.'); - } - - if ($canonicalize) { - self::createWarning('The optional $canonicalize parameter of assertEquals() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertEqualsCanonicalizing() instead.'); - } - - if ($ignoreCase) { - self::createWarning('The optional $ignoreCase parameter of assertEquals() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertEqualsIgnoringCase() instead.'); - } - // @codeCoverageIgnoreEnd - $constraint = new IsEqual( $expected, - $delta, - $maxDepth, - $canonicalize, - $ignoreCase + 0.0, + 10, + false, + false ); static::assertThat($actual, $constraint, $message); @@ -503,41 +485,18 @@ public static function assertEqualsWithDelta($expected, $actual, float $delta, s /** * Asserts that two variables are not equal. * - * @param float $delta - * @param int $maxDepth - * @param bool $canonicalize - * @param bool $ignoreCase - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ - public static function assertNotEquals($expected, $actual, string $message = '', $delta = 0.0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false): void + public static function assertNotEquals($expected, $actual, string $message = ''): void { - // @codeCoverageIgnoreStart - if ($delta !== 0.0) { - self::createWarning('The optional $delta parameter of assertNotEquals() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertNotEqualsWithDelta() instead.'); - } - - if ($maxDepth !== 10) { - self::createWarning('The optional $maxDepth parameter of assertNotEquals() is deprecated and will be removed in PHPUnit 9.'); - } - - if ($canonicalize) { - self::createWarning('The optional $canonicalize parameter of assertNotEquals() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertNotEqualsCanonicalizing() instead.'); - } - - if ($ignoreCase) { - self::createWarning('The optional $ignoreCase parameter of assertNotEquals() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertNotEqualsIgnoringCase() instead.'); - } - // @codeCoverageIgnoreEnd - $constraint = new LogicalNot( new IsEqual( $expected, - $delta, - $maxDepth, - $canonicalize, - $ignoreCase + 0.0, + 10, + false, + false ) ); @@ -2432,9 +2391,9 @@ public static function arrayHasKey($key): ArrayHasKey return new ArrayHasKey($key); } - public static function equalTo($value, float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false): IsEqual + public static function equalTo($value): IsEqual { - return new IsEqual($value, $delta, $maxDepth, $canonicalize, $ignoreCase); + return new IsEqual($value, 0.0, 10, false, false); } public static function isEmpty(): IsEmpty