diff --git a/tests/PHPStan/Analyser/AnalyserTest.php b/tests/PHPStan/Analyser/AnalyserTest.php index 297d612c8d..2eef38d74a 100644 --- a/tests/PHPStan/Analyser/AnalyserTest.php +++ b/tests/PHPStan/Analyser/AnalyserTest.php @@ -467,6 +467,21 @@ public function testIgnoreErrorInTraitUsingClassFilePath(string $pathToIgnore): $this->assertNoErrors($result); } + #[DataProvider('dataIgnoreErrorInTraitUsingClassFilePath')] + public function testIgnoreErrorInTraitUsingClassFilePathWithPartialAnalysis(string $pathToIgnore): void + { + $ignoreErrors = [ + [ + 'message' => '#Fail\.#', + 'path' => $pathToIgnore, + ], + ]; + $result = $this->runAnalyser($ignoreErrors, true, [ + __DIR__ . '/data/traits-ignore/Foo.php', + ], true); + $this->assertNoErrors($result); + } + public function testIgnoredErrorMissingMessage(): void { $ignoreErrors = [