@@ -276,8 +276,9 @@ public function flushListeners(): void
276
276
public function addError (Test $ test , Throwable $ t , float $ time ): void
277
277
{
278
278
if ($ t instanceof RiskyTestError) {
279
- $ this ->risky [] = new TestFailure ($ test , $ t );
280
- $ notifyMethod = 'addRiskyTest ' ;
279
+ $ this ->recordRisky ($ test , $ t );
280
+
281
+ $ notifyMethod = 'addRiskyTest ' ;
281
282
282
283
if ($ test instanceof TestCase) {
283
284
$ test ->markAsRisky ();
@@ -287,22 +288,25 @@ public function addError(Test $test, Throwable $t, float $time): void
287
288
$ this ->stop ();
288
289
}
289
290
} elseif ($ t instanceof IncompleteTest) {
290
- $ this ->notImplemented [] = new TestFailure ($ test , $ t );
291
- $ notifyMethod = 'addIncompleteTest ' ;
291
+ $ this ->recordNotImplemented ($ test , $ t );
292
+
293
+ $ notifyMethod = 'addIncompleteTest ' ;
292
294
293
295
if ($ this ->stopOnIncomplete ) {
294
296
$ this ->stop ();
295
297
}
296
298
} elseif ($ t instanceof SkippedTest) {
297
- $ this ->skipped [] = new TestFailure ($ test , $ t );
298
- $ notifyMethod = 'addSkippedTest ' ;
299
+ $ this ->recordSkipped ($ test , $ t );
300
+
301
+ $ notifyMethod = 'addSkippedTest ' ;
299
302
300
303
if ($ this ->stopOnSkipped ) {
301
304
$ this ->stop ();
302
305
}
303
306
} else {
304
- $ this ->errors [] = new TestFailure ($ test , $ t );
305
- $ notifyMethod = 'addError ' ;
307
+ $ this ->recordError ($ test , $ t );
308
+
309
+ $ notifyMethod = 'addError ' ;
306
310
307
311
if ($ this ->stopOnError || $ this ->stopOnFailure ) {
308
312
$ this ->stop ();
@@ -332,7 +336,7 @@ public function addWarning(Test $test, Warning $e, float $time): void
332
336
$ this ->stop ();
333
337
}
334
338
335
- $ this ->warnings [] = new TestFailure ($ test , $ e );
339
+ $ this ->recordWarning ($ test , $ e );
336
340
337
341
foreach ($ this ->listeners as $ listener ) {
338
342
$ listener ->addWarning ($ test , $ e , $ time );
@@ -348,8 +352,9 @@ public function addWarning(Test $test, Warning $e, float $time): void
348
352
public function addFailure (Test $ test , AssertionFailedError $ e , float $ time ): void
349
353
{
350
354
if ($ e instanceof RiskyTestError || $ e instanceof OutputError) {
351
- $ this ->risky [] = new TestFailure ($ test , $ e );
352
- $ notifyMethod = 'addRiskyTest ' ;
355
+ $ this ->recordRisky ($ test , $ e );
356
+
357
+ $ notifyMethod = 'addRiskyTest ' ;
353
358
354
359
if ($ test instanceof TestCase) {
355
360
$ test ->markAsRisky ();
@@ -359,15 +364,17 @@ public function addFailure(Test $test, AssertionFailedError $e, float $time): vo
359
364
$ this ->stop ();
360
365
}
361
366
} elseif ($ e instanceof IncompleteTest) {
362
- $ this ->notImplemented [] = new TestFailure ($ test , $ e );
363
- $ notifyMethod = 'addIncompleteTest ' ;
367
+ $ this ->recordNotImplemented ($ test , $ e );
368
+
369
+ $ notifyMethod = 'addIncompleteTest ' ;
364
370
365
371
if ($ this ->stopOnIncomplete ) {
366
372
$ this ->stop ();
367
373
}
368
374
} elseif ($ e instanceof SkippedTest) {
369
- $ this ->skipped [] = new TestFailure ($ test , $ e );
370
- $ notifyMethod = 'addSkippedTest ' ;
375
+ $ this ->recordSkipped ($ test , $ e );
376
+
377
+ $ notifyMethod = 'addSkippedTest ' ;
371
378
372
379
if ($ this ->stopOnSkipped ) {
373
380
$ this ->stop ();
@@ -1254,4 +1261,29 @@ public function setRegisterMockObjectsFromTestArgumentsRecursively(bool $flag):
1254
1261
{
1255
1262
$ this ->registerMockObjectsFromTestArgumentsRecursively = $ flag ;
1256
1263
}
1264
+
1265
+ private function recordError (Test $ test , Throwable $ t ): void
1266
+ {
1267
+ $ this ->errors [] = new TestFailure ($ test , $ t );
1268
+ }
1269
+
1270
+ private function recordNotImplemented (Test $ test , Throwable $ t ): void
1271
+ {
1272
+ $ this ->notImplemented [] = new TestFailure ($ test , $ t );
1273
+ }
1274
+
1275
+ private function recordRisky (Test $ test , Throwable $ t ): void
1276
+ {
1277
+ $ this ->risky [] = new TestFailure ($ test , $ t );
1278
+ }
1279
+
1280
+ private function recordSkipped (Test $ test , Throwable $ t ): void
1281
+ {
1282
+ $ this ->skipped [] = new TestFailure ($ test , $ t );
1283
+ }
1284
+
1285
+ private function recordWarning (Test $ test , Throwable $ t ): void
1286
+ {
1287
+ $ this ->warnings [] = new TestFailure ($ test , $ t );
1288
+ }
1257
1289
}
0 commit comments