diff --git a/src/Mixins/Expectation.php b/src/Mixins/Expectation.php index 48741dee..0513face 100644 --- a/src/Mixins/Expectation.php +++ b/src/Mixins/Expectation.php @@ -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."); } diff --git a/tests/.snapshots/success.txt b/tests/.snapshots/success.txt index 25d6aac3..cc563df2 100644 --- a/tests/.snapshots/success.txt +++ b/tests/.snapshots/success.txt @@ -917,4 +917,4 @@ PASS Tests\Visual\Version ✓ visual snapshot of help command output - Tests: 4 incomplete, 4 todos, 18 skipped, 634 passed (1554 assertions) \ No newline at end of file + Tests: 4 incomplete, 4 todos, 18 skipped, 634 passed (1559 assertions) \ No newline at end of file diff --git a/tests/Visual/Parallel.php b/tests/Visual/Parallel.php index 9d37e64d..5e83d922 100644 --- a/tests/Visual/Parallel.php +++ b/tests/Visual/Parallel.php @@ -13,6 +13,6 @@ $run = function () { }; test('parallel', function () use ($run) { - expect($run())->toContain('Tests: 4 incomplete, 4 todos, 15 skipped, 626 passed (1545 assertions)') + expect($run())->toContain('Tests: 4 incomplete, 4 todos, 15 skipped, 626 passed (1550 assertions)') ->toContain('Parallel: 3 processes'); });