Skip to content

Commit

Permalink
Add missing wrapper functions
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Oct 19, 2020
1 parent 53e1c2c commit 8f081a9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ChangeLog-9.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes of the PHPUnit 9.4 release series are documented in this fil

## [9.4.2] - 2020-MM-DD

### Added

* Added missing `PHPUnit\Framework\assertObjectEquals()` and `PHPUnit\Framework\objectEquals()` wrapper functions

### Changed

* `PHPUnit\Framework\Assert::assertObjectEquals()` is now `static`
Expand Down
22 changes: 22 additions & 0 deletions src/Framework/Assert/Functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
use PHPUnit\Framework\Constraint\LogicalNot;
use PHPUnit\Framework\Constraint\LogicalOr;
use PHPUnit\Framework\Constraint\LogicalXor;
use PHPUnit\Framework\Constraint\ObjectEquals;
use PHPUnit\Framework\Constraint\ObjectHasAttribute;
use PHPUnit\Framework\Constraint\RegularExpression;
use PHPUnit\Framework\Constraint\StringContains;
Expand Down Expand Up @@ -389,6 +390,20 @@ function assertNotEqualsWithDelta($expected, $actual, float $delta, string $mess
}
}

if (!function_exists('PHPUnit\Framework\assertObjectEquals')) {
/**
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertObjectEquals
*/
function assertObjectEquals(object $expected, object $actual, string $method = 'equals', string $message = ''): void
{
Assert::assertObjectEquals(...func_get_args());
}
}

if (!function_exists('PHPUnit\Framework\assertEmpty')) {
/**
* Asserts that a variable is empty.
Expand Down Expand Up @@ -2869,6 +2884,13 @@ function countOf(int $count): Count
}
}

if (!function_exists('PHPUnit\Framework\objectEquals')) {
function objectEquals(object $object, string $method = 'equals'): ObjectEquals
{
return Assert::objectEquals(...func_get_args());
}
}

if (!function_exists('PHPUnit\Framework\any')) {
/**
* Returns a matcher that matches when the method is executed
Expand Down

0 comments on commit 8f081a9

Please sign in to comment.