feat(toContainEqual): adds method name

This commit is contained in:
Nuno Maduro
2024-01-25 14:38:44 +00:00
parent 15cd7187e9
commit e95c4ee636
2 changed files with 17 additions and 14 deletions

View File

@ -4,33 +4,33 @@ use PHPUnit\Framework\ExpectationFailedException;
test('passes arrays', function () {
expect([1, 2, 42])->toContainEquals('42');
expect([1, 2, 42])->toContainEqual('42');
});
test('passes arrays with multiple needles', function () {
expect([1, 2, 42])->toContainEquals('42', '2');
expect([1, 2, 42])->toContainEqual('42', '2');
});
test('failures', function () {
expect([1, 2, 42])->toContainEquals('3');
expect([1, 2, 42])->toContainEqual('3');
})->throws(ExpectationFailedException::class);
test('failures with multiple needles (all failing)', function () {
expect([1, 2, 42])->toContainEquals('3', '4');
expect([1, 2, 42])->toContainEqual('3', '4');
})->throws(ExpectationFailedException::class);
test('failures with multiple needles (some failing)', function () {
expect([1, 2, 42])->toContainEquals('1', '3', '4');
expect([1, 2, 42])->toContainEqual('1', '3', '4');
})->throws(ExpectationFailedException::class);
test('not failures', function () {
expect([1, 2, 42])->not->toContainEquals('42');
expect([1, 2, 42])->not->toContainEqual('42');
})->throws(ExpectationFailedException::class);
test('not failures with multiple needles (all failing)', function () {
expect([1, 2, 42])->not->toContainEquals('42', '2');
expect([1, 2, 42])->not->toContainEqual('42', '2');
})->throws(ExpectationFailedException::class);
test('not failures with multiple needles (some failing)', function () {
expect([1, 2, 42])->not->toContainEquals('42', '1');
expect([1, 2, 42])->not->toContainEqual('42', '1');
})->throws(ExpectationFailedException::class);