diff --git a/tests/PHPStan/Analyser/Bug13813IntegrationTest.php b/tests/PHPStan/Analyser/Bug13813IntegrationTest.php index 25e937cbed..57fd84cf5a 100644 --- a/tests/PHPStan/Analyser/Bug13813IntegrationTest.php +++ b/tests/PHPStan/Analyser/Bug13813IntegrationTest.php @@ -17,11 +17,17 @@ class Bug13813IntegrationTest extends PHPStanTestCase public function testBug13813(): void { - error_reporting(E_ALL); - $analyzerResult = $this->runAnalyse([ - __DIR__ . '/data/bug-13813.php', - __DIR__ . '/Bug13813Rule.php', - ]); + $oldReporting = error_reporting(); + + try { + error_reporting(E_ALL); + $analyzerResult = $this->runAnalyse([ + __DIR__ . '/data/bug-13813.php', + __DIR__ . '/Bug13813Rule.php', + ]); + } finally { + error_reporting($oldReporting); + } $this->assertCount(2, $analyzerResult->getAllPhpErrors()); $this->assertCount(2, $analyzerResult->getFilteredPhpErrors());