fix: assertions on opposite expectations

This commit is contained in:
Nuno Maduro
2023-02-18 15:27:25 +00:00
parent 05989c35a7
commit f309e06292
3 changed files with 6 additions and 2 deletions

View File

@ -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.");
}