@@ -423,20 +423,25 @@ public static function dataErrorLimit(): iterable
423423 yield [
424424 'errorsBudget ' => null ,
425425 'usedLevel ' => '8 ' ,
426- 'showAllErrors ' => true ,
427- 'expected ' => ' ------ -------------------------------
428- Line Foo.php (in context of trait)
429- ------ -------------------------------
430- 12 Test
431- 13 Test
432- 14 Test
433- 15 Test
434- ------ -------------------------------
426+ 'showAllErrors ' => false ,
427+ 'expected ' => '
435428
429+ [ERROR] Found 1000+ errors
436430
437- [ERROR] Found 4 errors
431+ ' ,
432+ 'generateErrorsCount ' => TableErrorFormatter::ERRORS_LIMIT + 5 ,
433+ ];
434+
435+ yield [
436+ 'errorsBudget ' => null ,
437+ 'usedLevel ' => '8 ' ,
438+ 'showAllErrors ' => true ,
439+ 'expected ' => '
440+
441+ [ERROR] Found 1005 errors
438442
439443 ' ,
444+ 'generateErrorsCount ' => TableErrorFormatter::ERRORS_LIMIT + 5 ,
440445 ];
441446 }
442447
@@ -446,6 +451,7 @@ public function testErrorLimit(
446451 string $ usedLevel ,
447452 bool $ showAllErrors ,
448453 string $ expected ,
454+ int $ generateErrorsCount = 4 ,
449455 ): void
450456 {
451457 putenv ('COLUMNS=200 ' );
@@ -464,10 +470,11 @@ public function testErrorLimit(
464470 $ errorsBudget ,
465471 );
466472 $ errors = [];
467- $ errors [] = new Error ('Test ' , 'Foo.php (in context of trait) ' , 12 , filePath: 'Foo.php ' , traitFilePath: 'Bar.php ' );
468- $ errors [] = new Error ('Test ' , 'Foo.php (in context of trait) ' , 13 , filePath: 'Foo.php ' , traitFilePath: 'Bar.php ' );
469- $ errors [] = new Error ('Test ' , 'Foo.php (in context of trait) ' , 14 , filePath: 'Foo.php ' , traitFilePath: 'Bar.php ' );
470- $ errors [] = new Error ('Test ' , 'Foo.php (in context of trait) ' , 15 , filePath: 'Foo.php ' , traitFilePath: 'Bar.php ' );
473+ $ line = 12 ;
474+ for ($ i = 0 ; $ i < $ generateErrorsCount ; $ i ++) {
475+ $ errors [] = new Error ('Test ' , 'Foo.php (in context of trait) ' , $ line , filePath: 'Foo.php ' , traitFilePath: 'Bar.php ' );
476+ $ line ++;
477+ }
471478 $ formatter ->formatErrors (new AnalysisResult ($ errors , [], [], [], [], false , null , true , 0 , false , []), $ this ->getOutput ());
472479
473480 $ this ->assertStringContainsString ($ expected , $ this ->getOutputContent ());
0 commit comments