Skip to content

Commit 740cb3c

Browse files
Add test
1 parent b3fcd68 commit 740cb3c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/PHPStan/Analyser/AnalyserTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@ public function testFileWithAnIgnoredWrongIdentifier(): void
9898
$this->assertSame('Ignored error pattern wrong.identifier was not matched in reported errors.', $result[1]);
9999
}
100100

101+
public function testFileWithAnIgnoredWithIdentifierAndIdentifiers(): void
102+
{
103+
$result = $this->runAnalyser([['identifier' => 'some.identifier', 'identifiers' => ['wrong.identifiers']]], true, __DIR__ . '/data/bootstrap-error.php', false);
104+
$this->assertCount(2, $result);
105+
assert($result[0] instanceof Error);
106+
$this->assertSame('Fail.', $result[0]->getMessage());
107+
assert(is_string($result[1]));
108+
$this->assertSame('Ignored error pattern wrong.identifiers was not matched in reported errors.', $result[1]);
109+
}
110+
101111
public function testFileWithAnIgnoredErrorMessageAndCorrectIdentifier(): void
102112
{
103113
$result = $this->runAnalyser([['message' => '#Fail\.#', 'identifier' => 'tests.alwaysFail']], true, __DIR__ . '/data/bootstrap-error.php', false);

0 commit comments

Comments
 (0)