Skip to content

Commit f92b648

Browse files
committed
Add more tests
1 parent e0cdbb5 commit f92b648

File tree

6 files changed

+28
-2
lines changed

6 files changed

+28
-2
lines changed

tests/PHPStan/DependencyInjection/InvalidIgnoredErrorExceptionTest.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,25 @@ class InvalidIgnoredErrorExceptionTest extends PHPStanTestCase
1313
public static function dateValidateIgnoreErrors(): iterable
1414
{
1515
yield [
16-
__DIR__ . '/invalidIgnoreErrors/one.neon',
16+
__DIR__ . '/invalidIgnoreErrors/message-and-messages.neon',
1717
'An ignoreErrors entry cannot contain both message and messages fields.',
1818
];
1919
yield [
20-
__DIR__ . '/invalidIgnoreErrors/two.neon',
20+
__DIR__ . '/invalidIgnoreErrors/identifier-and-identifiers.neon',
21+
'An ignoreErrors entry cannot contain both identifier and identifiers fields.',
22+
];
23+
yield [
24+
__DIR__ . '/invalidIgnoreErrors/path-and-paths.neon',
2125
'An ignoreErrors entry cannot contain both path and paths fields.',
2226
];
27+
yield [
28+
__DIR__ . '/invalidIgnoreErrors/missing-main-key.neon',
29+
'An ignoreErrors entry must contain at least one of the following fields: message, messages, identifier, identifiers, path, paths.',
30+
];
31+
yield [
32+
__DIR__ . '/invalidIgnoreErrors/count-without-path.neon',
33+
'An ignoreErrors entry with count field must also contain path field.',
34+
];
2335
}
2436

2537
#[DataProvider('dateValidateIgnoreErrors')]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: '#One#'
5+
count: 3
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
identifier: argument.type
5+
identifiers: [argument.type]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
reportUnmatched: false

0 commit comments

Comments
 (0)