File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -43,10 +43,6 @@ public function __construct(
4343
4444 public function report (SlowTestList $ slowTestList ): string
4545 {
46- if ($ slowTestList ->isEmpty ()) {
47- return '' ;
48- }
49-
5046 return \implode ("\n" , \iterator_to_array ($ this ->lines ($ slowTestList )));
5147 }
5248
@@ -57,6 +53,12 @@ private function lines(SlowTestList $slowTestList): \Generator
5753 {
5854 $ slowTestCount = $ slowTestList ->count ();
5955
56+ if ($ slowTestCount ->equals (Count::fromInt (0 ))) {
57+ yield 'Could not detect any tests where the duration exceeded the maximum duration. ' ;
58+
59+ return ;
60+ }
61+
6062 if ($ slowTestCount ->equals (Count::fromInt (1 ))) {
6163 yield 'Detected 1 test where the duration exceeded the maximum duration. ' ;
6264 } else {
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ public function testReportReturnsEmptyStringWhenSlowTestListIsEmpty()
5757
5858 $ report = $ reporter ->report ($ slowTestList );
5959
60- self ::assertSame ('' , $ report );
60+ self ::assertSame ('Could not detect any tests where the duration exceeded the maximum duration. ' , $ report );
6161 }
6262
6363 /**
You can’t perform that action at this time.
0 commit comments