mirror of
https://github.com/pestphp/pest.git
synced 2026-03-07 00:07:22 +01:00
feat: adds fails
This commit is contained in:
@ -19,6 +19,7 @@ use Pest\Support\NullClosure;
|
||||
use Pest\Support\Str;
|
||||
use Pest\TestSuite;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use PHPUnit\Framework\AssertionFailedError;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
@ -57,6 +58,14 @@ final class TestCall
|
||||
$this->testSuite->beforeEach->get($this->filename)[0]($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Asserts that the test fails with the given message.
|
||||
*/
|
||||
public function fails(?string $message = null): self
|
||||
{
|
||||
return $this->throws(AssertionFailedError::class, $message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Asserts that the test throws the given `$exceptionClass` when called.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user