Closures passed to the skip method are now bound to the test case to allow for more complex logic.

This commit is contained in:
luke
2021-07-08 09:44:28 +01:00
parent 11ebe014fb
commit b97e206f7a
5 changed files with 43 additions and 7 deletions

View File

@ -1,5 +1,9 @@
<?php
beforeEach(function () {
$this->shouldSkip = true;
});
it('do not skips')
->skip(false)
->assertTrue(true);
@ -31,3 +35,7 @@ it('skips with condition and message')
it('skips when skip after assertion')
->assertTrue(true)
->skip();
it('can use something in the test case as a condition')
->skip(function () { return $this->shouldSkip; }, 'This test was skipped')
->assertTrue(false);