Skip to content

Commit f17d94d

Browse files
committed
Trait error ignored with used class path fails with partial analysis
1 parent f9a2208 commit f17d94d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/PHPStan/Analyser/AnalyserTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,21 @@ public function testIgnoreErrorInTraitUsingClassFilePath(string $pathToIgnore):
467467
$this->assertNoErrors($result);
468468
}
469469

470+
#[DataProvider('dataIgnoreErrorInTraitUsingClassFilePath')]
471+
public function testIgnoreErrorInTraitUsingClassFilePathWithPartialAnalysis(string $pathToIgnore): void
472+
{
473+
$ignoreErrors = [
474+
[
475+
'message' => '#Fail\.#',
476+
'path' => $pathToIgnore,
477+
],
478+
];
479+
$result = $this->runAnalyser($ignoreErrors, true, [
480+
__DIR__ . '/data/traits-ignore/Foo.php',
481+
], true);
482+
$this->assertNoErrors($result);
483+
}
484+
470485
public function testIgnoredErrorMissingMessage(): void
471486
{
472487
$ignoreErrors = [

0 commit comments

Comments
 (0)