Skip to content

Commit d7dd498

Browse files
committed
Add tests for error count
1 parent 3e6e696 commit d7dd498

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

tests/Rule/BaselinePerIdentifierFormatterTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public function testFormat(): void
2323
$formatter->formatErrors(
2424
$this->createAnalysisResult(
2525
[
26+
(new Error('Error simple', $fakeRoot . '/app/file.php', 1))->withIdentifier('sample.identifier'), // @phpstan-ignore phpstanApi.constructor
2627
(new Error('Error simple', $fakeRoot . '/app/file.php', 1))->withIdentifier('sample.identifier'), // @phpstan-ignore phpstanApi.constructor
2728
(new Error('Error to escape \'#', $fakeRoot . '/app/config.php', 2))->withIdentifier('another.identifier'), // @phpstan-ignore phpstanApi.constructor
2829
(new Error('Error 3', $fakeRoot . '/app/index.php', 3)), // @phpstan-ignore phpstanApi.constructor
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# total 1 error
1+
# total 2 error
22

33
parameters:
44
ignoreErrors:
55
-
66
message: '#^Error simple$#'
7-
count: 1
7+
count: 2
88
path: ../app/file.php

tests/Rule/data/baselines-php/sample.identifier.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php declare(strict_types = 1);
22

3-
// total 1 error
3+
// total 2 error
44

55
$ignoreErrors = [];
66
$ignoreErrors[] = [
77
'message' => '#^Error simple$#',
8-
'count' => 1,
8+
'count' => 2,
99
'path' => __DIR__ . '/../app/file.php',
1010
];
1111

0 commit comments

Comments
 (0)