Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tests/PHPStan/Analyser/Bug13813IntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class Bug13813IntegrationTest extends PHPStanTestCase

public function testBug13813(): void
{
$oldReporting = error_reporting();

error_reporting(E_ALL);
$analyzerResult = $this->runAnalyse([
__DIR__ . '/data/bug-13813.php',
Expand Down Expand Up @@ -44,6 +46,8 @@ public function testBug13813(): void
$analyzerResult->getAllPhpErrors()[1]->getMessage(),
);
}

error_reporting($oldReporting);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the:

		$analyzerResult = $this->runAnalyse([
			__DIR__ . '/data/bug-13813.php',
			__DIR__ . '/Bug13813Rule.php',
		]);

should be wrapped in a try-finally block and the restore be done there.

}

/**
Expand Down
Loading