Skip to content

Commit 1bdbca2

Browse files
committed
refactor(Assert): rename equal to equals
1 parent 3f63ce6 commit 1bdbca2

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/Assert.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static function notSame(mixed $expected, mixed $actual, string $message =
5858
* @param string $message Short description about what exactly is being asserted.
5959
* @throws AssertException when the assertion fails.
6060
*/
61-
public static function equal(mixed $expected, mixed $actual, string $message = ''): void
61+
public static function equals(mixed $expected, mixed $actual, string $message = ''): void
6262
{
6363
$actual == $expected
6464
? StaticState::log('Assert equal: `' . Support::stringify($expected) . '`', $message)
@@ -73,7 +73,7 @@ public static function equal(mixed $expected, mixed $actual, string $message = '
7373
* @param string $message Short description about what exactly is being asserted.
7474
* @throws AssertException when the assertion fails.
7575
*/
76-
public static function notEqual(mixed $expected, mixed $actual, string $message = ''): void
76+
public static function notEquals(mixed $expected, mixed $actual, string $message = ''): void
7777
{
7878
$actual != $expected
7979
? StaticState::log('Assert not equal: `' . Support::stringify($expected) . '`', $message)

tests/Testo/AsserTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
use Testo\Attribute\RetryPolicy;
1010
use Testo\Attribute\Test;
1111

12+
/**
13+
* Assertion examples.
14+
*/
1215
final class AsserTest
1316
{
1417
#[Test]
@@ -22,8 +25,8 @@ public function simpleAssertions(): void
2225
Assert::contains(1, [1,2,3]);
2326
Assert::contains(2, new \ArrayIterator([1,2,3]));
2427
Assert::instanceOf(\Exception::class, new \RuntimeException());
25-
Assert::equal(1, '1');
26-
Assert::notEqual(42,43);
28+
Assert::equals(1, '1');
29+
Assert::notEquals(42, 43);
2730
}
2831

2932
#[Test]

0 commit comments

Comments
 (0)