mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
Adds tap for Higher Order tests
This commit is contained in:
@ -409,6 +409,8 @@
|
||||
PASS Tests\Features\HigherOrderTests
|
||||
✓ it proxies calls to object
|
||||
✓ it is capable doing multiple assertions
|
||||
✓ it can tap into the test
|
||||
✓ it can use the returned instance from a tap
|
||||
|
||||
WARN Tests\Features\Incompleted
|
||||
… incompleted
|
||||
@ -578,5 +580,5 @@
|
||||
✓ it is a test
|
||||
✓ it uses correct parent class
|
||||
|
||||
Tests: 4 incompleted, 7 skipped, 362 passed
|
||||
Tests: 4 incompleted, 7 skipped, 364 passed
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
beforeEach()->assertTrue(true);
|
||||
|
||||
it('proxies calls to object')->assertTrue(true);
|
||||
@ -8,7 +10,14 @@ it('is capable doing multiple assertions')
|
||||
->assertTrue(true)
|
||||
->assertFalse(false);
|
||||
|
||||
//it('can tap into the test')
|
||||
it('can tap into the test')
|
||||
->expect('foo')->toBeString()->toBe('foo')
|
||||
->tap(function () { expect($this)->toBeInstanceOf(TestCase::class); })
|
||||
->and('hello world')->toBeString();
|
||||
|
||||
it('can use the returned instance from a tap')
|
||||
->expect('foo')->toBeString()->toBe('foo')
|
||||
->tap(function () { return expect($this); })
|
||||
->toBeInstanceOf(TestCase::class);
|
||||
|
||||
afterEach()->assertTrue(true);
|
||||
|
||||
Reference in New Issue
Block a user