Skip to content

Commit 225f4ea

Browse files
staabmsebastianbergmann
authored andcommitted
more precise non-isolated assertions
1 parent ab8a247 commit 225f4ea

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tests/end-to-end/regression/5592.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,4 @@ Test code or tested code removed exception handlers other than its own
6666
%sIssue5592Test.php:%i
6767

6868
FAILURES!
69-
Tests: 6, Assertions: 6, Failures: 4, Risky: 4.
69+
Tests: 6, Assertions: 10, Failures: 4, Risky: 4.

tests/end-to-end/regression/5592/Issue5592Test.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use function restore_exception_handler;
1414
use function set_error_handler;
1515
use function set_exception_handler;
16+
use Closure;
1617
use PHPUnit\Framework\TestCase;
1718
use PHPUnit\Runner\ErrorHandler;
1819
use Throwable;
@@ -47,15 +48,15 @@ public function testAddedAndRemovedExceptionHandler(): void
4748
$previous = set_exception_handler([$this, 'addedAndRemovedExceptionHandler']);
4849
restore_exception_handler();
4950

50-
$this->assertNull($previous);
51+
$this->assertInstanceOf(Closure::class, $previous);
5152
$this->assertTrue(true);
5253
}
5354

5455
public function testAddedExceptionHandler(): void
5556
{
5657
$previous = set_exception_handler([$this, 'addedExceptionHandler']);
5758

58-
$this->assertNull($previous);
59+
$this->assertInstanceOf(Closure::class, $previous);
5960
$this->assertTrue(false);
6061
}
6162

0 commit comments

Comments
 (0)