mirror of
https://github.com/pestphp/pest.git
synced 2026-03-07 00:07:22 +01:00
feat: re-adds tap to avoid BC
This commit is contained in:
@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user