feat(expect): fixes to contain with strings

This commit is contained in:
Nuno Maduro
2020-07-15 00:57:31 +02:00
parent e2deaae6c9
commit 2751bc9674
3 changed files with 10 additions and 5 deletions

View File

@ -2,10 +2,14 @@
use PHPUnit\Framework\ExpectationFailedException;
test('passes', function () {
test('passes strings', function () {
expect([1, 2, 42])->toContain(42);
});
test('passes arrays', function () {
expect('Nuno')->toContain('Nu');
});
test('failures', function () {
expect([1, 2, 42])->toContain(3);
})->throws(ExpectationFailedException::class);