@@ -96,13 +96,13 @@ public function testGenerateBaselineIgnoreNewErrorsRemoveFile(): void
9696 $ this ->assertStringContainsString ('[OK] Baseline generated with 1 error ' , $ output );
9797 }
9898
99- public function testGenerateBaselineIgnoreNewErrorsChangeFile (): void
99+ public function testGenerateBaselineIgnoreNewErrorsReducedErrorCount (): void
100100 {
101- $ baselineFile = __DIR__ . '/data-ignore-new-errors-baseline /baseline.neon ' ;
101+ $ baselineFile = __DIR__ . '/data-ignore-new-errors-compare /baseline.neon ' ;
102102 $ baselineFileSecondRun = __DIR__ . '/data-ignore-new-errors/baseline.neon ' ;
103103 $ this ->runCommand (0 , [
104- 'paths ' => [__DIR__ . '/data-ignore-new-errors-baseline /A.php ' ],
105- '--configuration ' => __DIR__ . '/data-ignore-new-errors-baseline /empty.neon ' ,
104+ 'paths ' => [__DIR__ . '/data-ignore-new-errors-compare /A.php ' ],
105+ '--configuration ' => __DIR__ . '/data-ignore-new-errors-compare /empty.neon ' ,
106106 '--level ' => '9 ' ,
107107 '--generate-baseline ' => $ baselineFile ,
108108 ]);
@@ -120,6 +120,30 @@ public function testGenerateBaselineIgnoreNewErrorsChangeFile(): void
120120 $ this ->assertStringContainsString ('[OK] Baseline generated with 2 errors ' , $ output );
121121 }
122122
123+ public function testGenerateBaselineIgnoreNewErrorsIncreasedErrorCount (): void
124+ {
125+ $ baselineFile = __DIR__ . '/data-ignore-new-errors/baseline.neon ' ;
126+ $ baselineFileSecondRun = __DIR__ . '/data-ignore-new-errors-compare/baseline.neon ' ;
127+ $ this ->runCommand (0 , [
128+ 'paths ' => [__DIR__ . '/data-ignore-new-errors/A.php ' ],
129+ '--configuration ' => __DIR__ . '/data-ignore-new-errors/empty.neon ' ,
130+ '--level ' => '9 ' ,
131+ '--generate-baseline ' => $ baselineFile ,
132+ ]);
133+
134+ rename ($ baselineFile , $ baselineFileSecondRun );
135+ $ output = $ this ->runCommand (0 , [
136+ 'paths ' => [__DIR__ . '/data-ignore-new-errors-compare/A.php ' ],
137+ '--configuration ' => $ baselineFileSecondRun ,
138+ '--level ' => '9 ' ,
139+ '--generate-baseline ' => $ baselineFileSecondRun ,
140+ '--ignore-new-errors ' => true ,
141+ ]);
142+ @unlink ($ baselineFileSecondRun );
143+
144+ $ this ->assertStringContainsString ('[OK] Baseline generated with 2 errors ' , $ output );
145+ }
146+
123147 public function testGenerateBaselineIgnoreNewErrorsEmptyBaseline (): void
124148 {
125149 $ baselineFile = __DIR__ . '/data-ignore-new-errors/baseline.neon ' ;
0 commit comments