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(
43
43
44
44
public function report (SlowTestList $ slowTestList ): string
45
45
{
46
- if ($ slowTestList ->isEmpty ()) {
47
- return '' ;
48
- }
49
-
50
46
return \implode ("\n" , \iterator_to_array ($ this ->lines ($ slowTestList )));
51
47
}
52
48
@@ -57,6 +53,12 @@ private function lines(SlowTestList $slowTestList): \Generator
57
53
{
58
54
$ slowTestCount = $ slowTestList ->count ();
59
55
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
+
60
62
if ($ slowTestCount ->equals (Count::fromInt (1 ))) {
61
63
yield 'Detected 1 test where the duration exceeded the maximum duration. ' ;
62
64
} else {
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ public function testReportReturnsEmptyStringWhenSlowTestListIsEmpty()
57
57
58
58
$ report = $ reporter ->report ($ slowTestList );
59
59
60
- self ::assertSame ('' , $ report );
60
+ self ::assertSame ('Could not detect any tests where the duration exceeded the maximum duration. ' , $ report );
61
61
}
62
62
63
63
/**
You can’t perform that action at this time.
0 commit comments