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.");
|
||||
}
|
||||
|
||||
@ -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)
|
||||
Tests: 4 incomplete, 4 todos, 18 skipped, 634 passed (1559 assertions)
|
||||
@ -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');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user