@@ -21,27 +21,29 @@ class SpeedTrapListener implements TestListener
21
21
* Increments as more suites are run, then decremented as they finish. All
22
22
* suites have been run when returns to 0.
23
23
*
24
- * @var integer
24
+ * @var int
25
25
*/
26
26
protected $ suites = 0 ;
27
27
28
28
/**
29
- * Time in milliseconds at which a test will be considered "slow" and be
30
- * reported by this listener .
29
+ * Test execution time ( milliseconds) after which a test will be considered
30
+ * "slow" and be included in the slowness report .
31
31
*
32
32
* @var int
33
33
*/
34
34
protected $ slowThreshold ;
35
35
36
36
/**
37
- * Number of tests to report on for slowness.
37
+ * Number of tests to print in slowness report .
38
38
*
39
39
* @var int
40
40
*/
41
41
protected $ reportLength ;
42
42
43
43
/**
44
44
* Collection of slow tests.
45
+ * Keys are labels describing the test (string)
46
+ * Values are total execution time of given test (int)
45
47
*
46
48
* @var array
47
49
*/
@@ -225,7 +227,7 @@ protected function toMilliseconds($time)
225
227
}
226
228
227
229
/**
228
- * Label for describing a test.
230
+ * Label describing a test.
229
231
*
230
232
* @param TestCase $test
231
233
* @return string
@@ -236,7 +238,7 @@ protected function makeLabel(TestCase $test)
236
238
}
237
239
238
240
/**
239
- * Calculate number of slow tests to report about .
241
+ * Calculate number of tests to include in slowness report .
240
242
*
241
243
* @return int
242
244
*/
@@ -246,9 +248,10 @@ protected function getReportLength()
246
248
}
247
249
248
250
/**
249
- * Find how many slow tests occurred that won't be shown due to list length.
251
+ * Calculate number of slow tests to be hidden from the slowness report
252
+ * due to list length.
250
253
*
251
- * @return int Number of hidden slow tests
254
+ * @return int
252
255
*/
253
256
protected function getHiddenCount ()
254
257
{
@@ -264,15 +267,15 @@ protected function getHiddenCount()
264
267
}
265
268
266
269
/**
267
- * Renders slow test report header.
270
+ * Renders slowness report header.
268
271
*/
269
272
protected function renderHeader ()
270
273
{
271
274
echo sprintf ("\n\nYou should really fix these slow tests (>%sms)... \n" , $ this ->slowThreshold );
272
275
}
273
276
274
277
/**
275
- * Renders slow test report body.
278
+ * Renders slowness report body.
276
279
*/
277
280
protected function renderBody ()
278
281
{
@@ -288,7 +291,7 @@ protected function renderBody()
288
291
}
289
292
290
293
/**
291
- * Renders slow test report footer.
294
+ * Renders slowness report footer.
292
295
*/
293
296
protected function renderFooter ()
294
297
{
@@ -309,12 +312,12 @@ protected function loadOptions(array $options)
309
312
}
310
313
311
314
/**
312
- * Get slow test threshold for given test. A TestCase can override the
313
- * suite-wide slow threshold by using the annotation @slowThreshold with
314
- * the threshold value in milliseconds.
315
+ * Calculate slow test threshold for given test. A TestCase may override the
316
+ * suite-wide slowness threshold by using the annotation { @slowThreshold}
317
+ * with a threshold value in milliseconds.
315
318
*
316
- * The following test will only be considered slow when its execution time
317
- * reaches 5000ms (5 seconds):
319
+ * For example, the following test would be considered slow if its execution
320
+ * time meets or exceeds 5000ms (5 seconds):
318
321
*
319
322
* <code>
320
323
* \@slowThreshold 5000
0 commit comments