@@ -52,6 +52,7 @@ public function testReportReturnsEmptyStringWhenSlowTestListIsEmpty()
52
52
53
53
$ reporter = new Reporter \DefaultReporter (
54
54
new Formatter \DefaultDurationFormatter (),
55
+ MaximumDuration::fromDuration (Duration::fromMilliseconds ($ faker ->numberBetween (0 ))),
55
56
MaximumCount::fromCount (Count::fromInt ($ faker ->numberBetween (1 )))
56
57
);
57
58
@@ -65,11 +66,13 @@ public function testReportReturnsEmptyStringWhenSlowTestListIsEmpty()
65
66
*/
66
67
public function testReportReturnsReportWhenSlowTestListHasFewerSlowTestsThanMaximumCount (
67
68
string $ expectedReport ,
69
+ MaximumDuration $ maximumDuration ,
68
70
MaximumCount $ maximumCount ,
69
71
SlowTestList $ slowTestList
70
72
) {
71
73
$ reporter = new Reporter \DefaultReporter (
72
74
new Formatter \DefaultDurationFormatter (),
75
+ $ maximumDuration ,
73
76
$ maximumCount
74
77
);
75
78
@@ -79,7 +82,7 @@ public function testReportReturnsReportWhenSlowTestListHasFewerSlowTestsThanMaxi
79
82
}
80
83
81
84
/**
82
- * @return \Generator<string, array{0: string, 1: MaximumCount , 2: SlowTestList}>
85
+ * @return \Generator<string, array{0: string, 1: MaximumDuration , 2: MaximumCount, 3 : SlowTestList}>
83
86
*/
84
87
public static function provideExpectedReportMaximumCountAndSlowTestList (): iterable
85
88
{
@@ -91,6 +94,7 @@ public static function provideExpectedReportMaximumCountAndSlowTestList(): itera
91
94
1. 00:00.300 (00:00.100) FooTest::test
92
95
TXT
93
96
,
97
+ MaximumDuration::fromDuration (Duration::fromMilliseconds (500 )),
94
98
MaximumCount::fromCount (Count::fromInt (1 )),
95
99
SlowTestList::create (
96
100
SlowTest::create (
@@ -109,6 +113,7 @@ public static function provideExpectedReportMaximumCountAndSlowTestList(): itera
109
113
2. 00:00.275 (00:00.100) BarTest::test
110
114
TXT
111
115
,
116
+ MaximumDuration::fromDuration (Duration::fromMilliseconds (500 )),
112
117
MaximumCount::fromCount (Count::fromInt (2 )),
113
118
SlowTestList::create (
114
119
SlowTest::create (
@@ -134,6 +139,7 @@ public static function provideExpectedReportMaximumCountAndSlowTestList(): itera
134
139
3. 00:00.250 (00:00.100) BazTest::test
135
140
TXT
136
141
,
142
+ MaximumDuration::fromDuration (Duration::fromMilliseconds (500 )),
137
143
MaximumCount::fromCount (Count::fromInt (3 )),
138
144
SlowTestList::create (
139
145
SlowTest::create (
@@ -165,6 +171,7 @@ public static function provideExpectedReportMaximumCountAndSlowTestList(): itera
165
171
3. 00:00.250 (00:00.100) BazTest::test
166
172
TXT
167
173
,
174
+ MaximumDuration::fromDuration (Duration::fromMilliseconds (500 )),
168
175
MaximumCount::fromCount (Count::fromInt (3 )),
169
176
SlowTestList::create (
170
177
SlowTest::create (
@@ -203,6 +210,7 @@ public static function provideExpectedReportMaximumCountAndSlowTestList(): itera
203
210
10. 00:00.110 (00:00.100) FredTest::test
204
211
TXT
205
212
,
213
+ MaximumDuration::fromDuration (Duration::fromMilliseconds (500 )),
206
214
MaximumCount::fromCount (Count::fromInt (10 )),
207
215
SlowTestList::create (
208
216
SlowTest::create (
@@ -276,6 +284,7 @@ public static function provideExpectedReportMaximumCountAndSlowTestList(): itera
276
284
There is 1 additional slow test that is not listed here.
277
285
TXT
278
286
,
287
+ MaximumDuration::fromDuration (Duration::fromMilliseconds (500 )),
279
288
MaximumCount::fromCount (Count::fromInt (1 )),
280
289
SlowTestList::create (
281
290
SlowTest::create (
@@ -301,6 +310,7 @@ public static function provideExpectedReportMaximumCountAndSlowTestList(): itera
301
310
There are 2 additional slow tests that are not listed here.
302
311
TXT
303
312
,
313
+ MaximumDuration::fromDuration (Duration::fromMilliseconds (500 )),
304
314
MaximumCount::fromCount (Count::fromInt (1 )),
305
315
SlowTestList::create (
306
316
SlowTest::create (
@@ -325,9 +335,10 @@ public static function provideExpectedReportMaximumCountAndSlowTestList(): itera
325
335
],
326
336
];
327
337
328
- foreach ($ values as $ key => list ($ expected , $ maximumCount , $ slowTestList )) {
338
+ foreach ($ values as $ key => list ($ expected , $ maximumDuration , $ maximumCount , $ slowTestList )) {
329
339
yield $ key => [
330
340
$ expected ,
341
+ $ maximumDuration ,
331
342
$ maximumCount ,
332
343
$ slowTestList ,
333
344
];
0 commit comments