mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
Closures passed to the skip method are now bound to the test case to allow for more complex logic.
This commit is contained in:
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user