diff --git a/tests/PHPStan/Analyser/Bug13813IntegrationTest.php b/tests/PHPStan/Analyser/Bug13813IntegrationTest.php index 943a17c084..06fe8f64ae 100644 --- a/tests/PHPStan/Analyser/Bug13813IntegrationTest.php +++ b/tests/PHPStan/Analyser/Bug13813IntegrationTest.php @@ -24,14 +24,25 @@ public function testBug13813(): void $this->assertCount(2, $analyzerResult->getAllPhpErrors()); $this->assertCount(2, $analyzerResult->getFilteredPhpErrors()); - $this->assertSame( - 'Warning: Undefined variable $x', - $analyzerResult->getAllPhpErrors()[0]->getMessage() - ); - $this->assertSame( - 'Warning: Undefined variable $x', - $analyzerResult->getAllPhpErrors()[1]->getMessage() - ); + if (PHP_VERSION_ID >= 80000) { + $this->assertSame( + 'Warning: Undefined variable $x', + $analyzerResult->getAllPhpErrors()[0]->getMessage(), + ); + $this->assertSame( + 'Warning: Undefined variable $x', + $analyzerResult->getAllPhpErrors()[1]->getMessage(), + ); + } else { + $this->assertSame( + 'Notice: Undefined variable $x', + $analyzerResult->getAllPhpErrors()[0]->getMessage(), + ); + $this->assertSame( + 'Notice: Undefined variable $x', + $analyzerResult->getAllPhpErrors()[1]->getMessage(), + ); + } } /**