55namespace Symplify \PHPStanExtensions \Tests \ErrorFormatter ;
66
77use Iterator ;
8- use PHPStan \Analyser \Error ;
9- use PHPStan \Command \AnalysisResult ;
10- use PHPStan \ShouldNotHappenException ;
118use PHPStan \Testing \ErrorFormatterTestCase ;
129use PHPUnit \Framework \Attributes \DataProvider ;
1310use Symplify \PHPStanExtensions \ErrorFormatter \SymplifyErrorFormatter ;
@@ -20,9 +17,9 @@ final class SymplifyErrorFormatterVerboseTest extends ErrorFormatterTestCase
2017 #[DataProvider('provideData ' )]
2118 public function testFormatErrors (
2219 string $ message ,
23- int $ expectedExitCode ,
24- int $ numFileErrors ,
25- int $ numGenericErrors ,
20+ int $ expectedExitCode ,
21+ int $ numFileErrors ,
22+ int $ numGenericErrors ,
2623 string $ expectedOutputFile ,
2724 ): void {
2825 $ symplifyErrorFormatter = self ::getContainer ()->getByType (SymplifyErrorFormatter::class);
@@ -33,15 +30,15 @@ public function testFormatErrors(
3330
3431 $ this ->assertSame ($ expectedExitCode , $ resultCode );
3532
36- $ this ->assertStringMatchesFormatFile ($ expectedOutputFile , $ this ->getOutputContent (verbose: true ));
33+ $ this ->assertStringMatchesFormatFile ($ expectedOutputFile , str_replace ( "\r" , "\r\n" , $ this ->getOutputContent (verbose: true ) ));
3734 }
3835
3936 /**
4037 * @return Iterator<mixed>
4138 */
4239 public static function provideData (): Iterator
4340 {
44- yield ['Some message ' , 1 , 1 , 1 , __DIR__ . '/Fixture/expected_single_message_many_files_report_verbose.txt ' ];
41+ yield ['Some message ' , 1 , 6 , 0 , __DIR__ . '/Fixture/expected_single_message_many_files_report_verbose.txt ' ];
4542 }
4643
4744 /**
@@ -51,13 +48,4 @@ public static function getAdditionalConfigFiles(): array
5148 {
5249 return [__DIR__ . '/../../config/config.neon ' ];
5350 }
54-
55- protected function getAnalysisResult ($ numFileErrors , int $ numGenericErrors ): AnalysisResult
56- {
57- // @phpstan-ignore phpstanApi.constructor
58- $ fileErrors = [new Error ('Foo ' , self ::DIRECTORY_PATH . '/folder with unicode 😃/file name with "spaces" and unicode 😃.php ' , 4 , identifier: 'identical.alwaysFalse ' )];
59-
60- // @phpstan-ignore phpstanApi.constructor
61- return new AnalysisResult ($ fileErrors , [], [], [], [], \false, null , \true, 0 , \false, []);
62- }
6351}
0 commit comments