Skip to content

Commit e44856d

Browse files
authored
Prevent global side-effect in Bug13813IntegrationTest
1 parent a205938 commit e44856d

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

tests/PHPStan/Analyser/Bug13813IntegrationTest.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,17 @@ class Bug13813IntegrationTest extends PHPStanTestCase
1717

1818
public function testBug13813(): void
1919
{
20-
error_reporting(E_ALL);
21-
$analyzerResult = $this->runAnalyse([
22-
__DIR__ . '/data/bug-13813.php',
23-
__DIR__ . '/Bug13813Rule.php',
24-
]);
20+
$oldReporting = error_reporting();
21+
22+
try {
23+
error_reporting(E_ALL);
24+
$analyzerResult = $this->runAnalyse([
25+
__DIR__ . '/data/bug-13813.php',
26+
__DIR__ . '/Bug13813Rule.php',
27+
]);
28+
} finally {
29+
error_reporting($oldReporting);
30+
}
2531
$this->assertCount(2, $analyzerResult->getAllPhpErrors());
2632
$this->assertCount(2, $analyzerResult->getFilteredPhpErrors());
2733

0 commit comments

Comments
 (0)