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

@ -143,11 +143,9 @@ final class TestCall
? $conditionOrMessage
: $message;
if ($condition() !== false) {
$this->testCaseFactory
->chains
->add(Backtrace::file(), Backtrace::line(), 'markTestSkipped', [$message]);
}
$this->testCaseFactory
->chains
->addWhen($condition, Backtrace::file(), Backtrace::line(), 'markTestSkipped', [$message]);
return $this;
}