mirror of
https://github.com/pestphp/pest.git
synced 2026-03-07 16:27:23 +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:
@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user