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

@ -24,6 +24,16 @@ final class HigherOrderMessageCollection
$this->messages[] = new HigherOrderMessage($filename, $line, $methodName, $arguments);
}
/**
* Adds a new higher order message to the collection if the callable condition is does not return false.
*
* @param array<int, mixed> $arguments
*/
public function addWhen(callable $condition, string $filename, int $line, string $methodName, array $arguments): void
{
$this->messages[] = (new HigherOrderMessage($filename, $line, $methodName, $arguments))->when($condition);
}
/**
* Proxy all the messages starting from the target.
*/