Merge pull request #196 from DannyvdSluijs/feature-fix-skip-on-higher-order-test

Revert to original target if new target is null
This commit is contained in:
Nuno Maduro
2020-09-30 21:41:59 +02:00
committed by GitHub
4 changed files with 12 additions and 2 deletions

View File

@ -30,7 +30,7 @@ final class HigherOrderMessageCollection
public function chain(object $target): void
{
foreach ($this->messages as $message) {
$target = $message->call($target);
$target = $message->call($target) ?? $target;
}
}

View File

@ -278,6 +278,7 @@
PASS Tests\Features\HigherOrderTests
✓ it proxies calls to object
✓ it is capable doing multiple assertions
PASS Tests\Features\It
✓ it is a test
@ -302,6 +303,7 @@
- it skips with truthy closure condition
✓ it do not skips with falsy closure condition
- it skips with condition and message → skipped because foo
- it skips when skip after assertion
PASS Tests\Features\Test
✓ a test
@ -383,5 +385,5 @@
✓ depends with defined arguments
✓ depends run test only once
Tests: 6 skipped, 226 passed
Tests: 7 skipped, 227 passed

View File

@ -4,4 +4,8 @@ beforeEach()->assertTrue(true);
it('proxies calls to object')->assertTrue(true);
it('is capable doing multiple assertions')
->assertTrue(true)
->assertFalse(false);
afterEach()->assertTrue(true);

View File

@ -27,3 +27,7 @@ it('do not skips with falsy closure condition')
it('skips with condition and message')
->skip(true, 'skipped because foo')
->assertTrue(false);
it('skips when skip after assertion')
->assertTrue(true)
->skip();