Adds support for receiving datasets in higher order tests

This commit is contained in:
luke
2021-07-21 07:40:19 +01:00
parent 47ceb2419b
commit 371620d161
3 changed files with 26 additions and 2 deletions

View File

@ -27,4 +27,13 @@ it('can tap into the test')
->toBe('foo')
->and('hello world')->toBeString();
it('can pass datasets into the expect callables')
->with([[1, 2, 3]])
->expect(function (...$numbers) { return $numbers; })->toBe([1, 2, 3])
->and(function (...$numbers) { return $numbers; })->toBe([1, 2, 3]);
it('can pass datasets into the tap callable')
->with([[1, 2, 3]])
->tap(function (...$numbers) { expect($numbers)->toBe([1, 2, 3]); });
afterEach()->assertTrue(true);