Skip to content

Commit e0cdbb5

Browse files
committed
Test
1 parent 9f25d0b commit e0cdbb5

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
}
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+
messages: ['#Two#']
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
path: ../IgnoreErrorsTest.php
5+
paths: [../IgnoreErrorsTest.php]

0 commit comments

Comments
 (0)