mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
fix: assertions on opposite expectations
This commit is contained in:
@ -865,6 +865,8 @@ final class Expectation
|
||||
} catch (Throwable $e) {
|
||||
if (! class_exists($exception)) {
|
||||
if ($e instanceof Error && $e->getMessage() === "Class \"$exception\" not found") {
|
||||
Assert::assertTrue(true);
|
||||
|
||||
throw $e;
|
||||
}
|
||||
|
||||
@ -883,6 +885,8 @@ final class Expectation
|
||||
return $this;
|
||||
}
|
||||
|
||||
Assert::assertTrue(true);
|
||||
|
||||
if (! class_exists($exception)) {
|
||||
throw new ExpectationFailedException("Exception with message \"$exception\" not thrown.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user