Skip to content

Commit

Permalink
Merge pull request #43 from Yoast/feature/readme-tweaks
Browse files Browse the repository at this point in the history
README: minor updates
  • Loading branch information
jrfnl authored Jun 21, 2021
2 parents 5d257d5 + 7c08a7c commit 473ab5d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ For the polyfills to work, a test class is **required** to be a (grand-)child of

If your library still needs to support PHP < 5.6 and therefore needs PHPUnit 4 for testing, there are a few caveats when using the traits stand-alone as we then enter "double-polyfill" territory.

To prevent "conflicting method names" errors when a trait is `use`d multiple times in a class, the traits offered here do not attempt to solve this.
To prevent _"conflicting method names"_ errors when a trait is `use`d multiple times in a class, the traits offered here do not attempt to solve this.

You will need to make sure to `use` any additional traits needed for the polyfills to work.

Expand Down Expand Up @@ -433,27 +433,28 @@ if ( self::shouldClosedResourceAssertionBeSkipped( $actual ) === false ) {
}
```

> :point_right: While this polyfill is tested extensively, testing for these kind of bugs exhaustively is _hard_.
> :point_right: While this polyfill is tested extensively, testing for these kind of bugs _exhaustively_ is _hard_.
> Please [report any bugs](https://github.com/Yoast/PHPUnit-Polyfills/issues/new/choose) found and include a clear code sample to reproduce the issue.
#### PHPUnit < 9.4.0: `Yoast\PHPUnitPolyfills\Polyfills\AssertObjectEquals`

Polyfills the [`Assert::assertObjectEquals()`] method to verify two (value) objects are considered equal.
This assertion expects an object to contain a comparator method in the object itself. This comparator method is subsequently called to verify the "equalness" of the objects.

The `assertObjectEquals() assertion was introduced in PHPUnit 9.4.0.
The `assertObjectEquals()` assertion was introduced in PHPUnit 9.4.0.

> :info: Due to [limitations in how this assertion is implemented in PHPUnit] itself, it is currently not possible to create a single comparator method which will be compatible with both PHP < 7.0 and PHP 7.0 or higher.
> :information_source: Due to [limitations in how this assertion is implemented in PHPUnit] itself, it is currently not possible to create a single comparator method which will be compatible with both PHP < 7.0 and PHP 7.0 or higher.
>
> In effect two declarations of the same object would be needed to be compatible with PHP < 7.0 and PHP 7.0 and higher and still allow for testing the object using the `assertObjectEquals()` assertion.
>
> Due to this limitation, it is recommended to only use this assertion if the minimum supported PHP version of a project is PHP 7.0 or higher; or if the project does not run its tests on PHPUnit >= 9.4.0.
>
> The implementation of this assertion in the Polyfills is PHP cross-version compatible.
[limitations in how this assertion is implemented in PHPUnit]: https://github.com/sebastianbergmann/phpunit/issues/4707

<!--
COMMENT: No documentation available (yet) for this assertion on the PHPUnit site.
-->
[`Assert::assertObjectEquals()`]: https://phpunit.readthedocs.io/en/stable/assertions.html#assertobjectequals


### Helper traits

Expand Down

0 comments on commit 473ab5d

Please sign in to comment.