feat: re-adds tap to avoid BC

This commit is contained in:
Nuno Maduro
2023-03-14 19:09:46 +00:00
parent fccb90c8ea
commit d71af91360
5 changed files with 29 additions and 3 deletions

View File

@ -31,6 +31,14 @@ it('can defer a method until after test setup')
->toBe('foo')
->and('hello world')->toBeString();
it('can tap a method until after test setup')
->expect('foo')->toBeString()
->tap(function () {
expect($this)->toBeInstanceOf(TestCase::class);
})
->toBe('foo')
->and('hello world')->toBeString();
it('can pass datasets into the expect callables')
->with([[1, 2, 3]])
->expect(function (...$numbers) {
@ -46,6 +54,12 @@ it('can pass datasets into the defer callable')
expect($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]);
});
it('can pass shared datasets into callables')
->with('numbers.closure.wrapped')
->expect(function ($value) {