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

Commit ae4f36b

Browse files
yns88fredemmott
authored andcommitted
Undeprecate toEqual / toNotEqual (#14)
* Undeprecate toEqual / toNotBeEqual These functions are back in style now, apparently. * shim to Same instead of PHPEqual * Add docblocks
1 parent 86e030b commit ae4f36b

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/ExpectObj.hack

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,17 @@ class ExpectObj<T> extends Assert {
2323
*
2424
*/
2525

26-
<<__Deprecated("Use toBeSame() or toBePHPEqual()")>>
26+
/**
27+
* Asserts: $actual === $expected
28+
* Note: Two objects are considered the same if they reference the same
29+
* instance
30+
*/
2731
public function toEqual(
2832
mixed $expected,
2933
string $msg = '',
3034
mixed ...$args
3135
): void {
32-
$this->toBePHPEqual($expected, $msg, ...$args);
36+
$this->toBeSame($expected, $msg, ...$args);
3337
}
3438

3539
/**
@@ -357,13 +361,17 @@ class ExpectObj<T> extends Assert {
357361
**************************************
358362
**************************************/
359363

360-
<<__Deprecated("Use toNotBeSame() or toNotBePHPEqual()")>>
364+
/**
365+
* Asserts: $actual !== $expected
366+
* Note: Two objects are considered the same if they reference the same
367+
* instance
368+
*/
361369
public function toNotEqual(
362370
mixed $expected,
363371
string $msg = '',
364372
mixed ...$args
365373
): void {
366-
$this->toNotBePHPEqual($expected, $msg, ...$args);
374+
$this->toNotBeSame($expected, $msg, ...$args);
367375
}
368376

369377
public function toNotBePHPEqual(

0 commit comments

Comments
 (0)