mirror of
https://github.com/pestphp/pest.git
synced 2026-03-07 00:07:22 +01:00
fix: risky tests on oposite expectations
This commit is contained in:
@ -6,6 +6,7 @@ namespace Pest\Expectations;
|
||||
|
||||
use Pest\Expectation;
|
||||
use Pest\Support\Arr;
|
||||
use PHPUnit\Framework\Assert;
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
use SebastianBergmann\Exporter\Exporter;
|
||||
|
||||
@ -64,6 +65,8 @@ final class OppositeExpectation
|
||||
/* @phpstan-ignore-next-line */
|
||||
$this->original->{$name}(...$arguments);
|
||||
} catch (ExpectationFailedException) {
|
||||
Assert::assertTrue(true);
|
||||
|
||||
return $this->original;
|
||||
}
|
||||
|
||||
@ -80,6 +83,8 @@ final class OppositeExpectation
|
||||
try {
|
||||
$this->original->{$name}; // @phpstan-ignore-line
|
||||
} catch (ExpectationFailedException) { // @phpstan-ignore-line
|
||||
Assert::assertTrue(true);
|
||||
|
||||
return $this->original;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user