Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Commit

Permalink
Undeprecate toEqual / toNotEqual (#14)
Browse files Browse the repository at this point in the history
* Undeprecate toEqual / toNotBeEqual

These functions are back in style now, apparently.

* shim to Same instead of PHPEqual

* Add docblocks
  • Loading branch information
yns88 authored and fredemmott committed Jul 12, 2019
1 parent 86e030b commit ae4f36b
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/ExpectObj.hack
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ class ExpectObj<T> extends Assert {
*
*/

<<__Deprecated("Use toBeSame() or toBePHPEqual()")>>
/**
* Asserts: $actual === $expected
* Note: Two objects are considered the same if they reference the same
* instance
*/
public function toEqual(
mixed $expected,
string $msg = '',
mixed ...$args
): void {
$this->toBePHPEqual($expected, $msg, ...$args);
$this->toBeSame($expected, $msg, ...$args);
}

/**
Expand Down Expand Up @@ -357,13 +361,17 @@ class ExpectObj<T> extends Assert {
**************************************
**************************************/

<<__Deprecated("Use toNotBeSame() or toNotBePHPEqual()")>>
/**
* Asserts: $actual !== $expected
* Note: Two objects are considered the same if they reference the same
* instance
*/
public function toNotEqual(
mixed $expected,
string $msg = '',
mixed ...$args
): void {
$this->toNotBePHPEqual($expected, $msg, ...$args);
$this->toNotBeSame($expected, $msg, ...$args);
}

public function toNotBePHPEqual(
Expand Down

0 comments on commit ae4f36b

Please sign in to comment.