Skip to content

Commit

Permalink
Document assertObjectNotEquals()
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed May 12, 2024
1 parent 25ba795 commit 1189f9e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/assertions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ It is a bad practice to use ``assertEquals()`` (and its inverse, ``assertNotEqua

The most common use case for custom comparators are Value Objects. These objects usually have an ``equals(self $other): bool`` method (or a method just like that but with a different name) for comparing two instances of the Value Object's type. ``assertObjectEquals()`` makes custom comparison of objects convenient for this common use case:

``assertObjectNotEquals()`` is the inverse of this assertion and takes the same arguments.

.. literalinclude:: examples/assertions/ObjectEqualsTest.php
:caption: Usage of assertObjectEquals()
:language: php
Expand Down

0 comments on commit 1189f9e

Please sign in to comment.