mirror of
https://github.com/pestphp/pest.git
synced 2026-03-12 02:37: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\Expectation;
|
||||||
use Pest\Support\Arr;
|
use Pest\Support\Arr;
|
||||||
|
use PHPUnit\Framework\Assert;
|
||||||
use PHPUnit\Framework\ExpectationFailedException;
|
use PHPUnit\Framework\ExpectationFailedException;
|
||||||
use SebastianBergmann\Exporter\Exporter;
|
use SebastianBergmann\Exporter\Exporter;
|
||||||
|
|
||||||
@ -64,6 +65,8 @@ final class OppositeExpectation
|
|||||||
/* @phpstan-ignore-next-line */
|
/* @phpstan-ignore-next-line */
|
||||||
$this->original->{$name}(...$arguments);
|
$this->original->{$name}(...$arguments);
|
||||||
} catch (ExpectationFailedException) {
|
} catch (ExpectationFailedException) {
|
||||||
|
Assert::assertTrue(true);
|
||||||
|
|
||||||
return $this->original;
|
return $this->original;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,6 +83,8 @@ final class OppositeExpectation
|
|||||||
try {
|
try {
|
||||||
$this->original->{$name}; // @phpstan-ignore-line
|
$this->original->{$name}; // @phpstan-ignore-line
|
||||||
} catch (ExpectationFailedException) { // @phpstan-ignore-line
|
} catch (ExpectationFailedException) { // @phpstan-ignore-line
|
||||||
|
Assert::assertTrue(true);
|
||||||
|
|
||||||
return $this->original;
|
return $this->original;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user