File tree Expand file tree Collapse file tree 3 files changed +51
-0
lines changed
tests/PHPStan/DependencyInjection Expand file tree Collapse file tree 3 files changed +51
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php declare (strict_types = 1 );
2+
3+ namespace PHPStan \DependencyInjection ;
4+
5+ use PHPStan \Testing \PHPStanTestCase ;
6+ use PHPUnit \Framework \Attributes \DataProvider ;
7+
8+ class InvalidIgnoredErrorExceptionTest extends PHPStanTestCase
9+ {
10+
11+ private static string $ configFile ;
12+
13+ public static function dateValidateIgnoreErrors (): iterable
14+ {
15+ yield [
16+ __DIR__ . '/invalidIgnoreErrors/one.neon ' ,
17+ 'An ignoreErrors entry cannot contain both message and messages fields. ' ,
18+ ];
19+ yield [
20+ __DIR__ . '/invalidIgnoreErrors/two.neon ' ,
21+ 'An ignoreErrors entry cannot contain both path and paths fields. ' ,
22+ ];
23+ }
24+
25+ #[DataProvider('dateValidateIgnoreErrors ' )]
26+ public function testValidateIgnoreErrors (string $ file , string $ expectedMessage ): void
27+ {
28+ self ::$ configFile = $ file ;
29+ $ this ->expectExceptionMessage ($ expectedMessage );
30+ self ::getContainer ();
31+ }
32+
33+ public static function getAdditionalConfigFiles (): array
34+ {
35+ return [
36+ __DIR__ . '/../../../conf/bleedingEdge.neon ' ,
37+ self ::$ configFile ,
38+ ];
39+ }
40+
41+ }
Original file line number Diff line number Diff line change 1+ parameters :
2+ ignoreErrors :
3+ -
4+ message : ' #One#'
5+ messages : [' #Two#' ]
Original file line number Diff line number Diff line change 1+ parameters :
2+ ignoreErrors :
3+ -
4+ path : ../IgnoreErrorsTest.php
5+ paths : [../IgnoreErrorsTest.php ]
You can’t perform that action at this time.
0 commit comments