File tree Expand file tree Collapse file tree 1 file changed +22
-17
lines changed Expand file tree Collapse file tree 1 file changed +22
-17
lines changed Original file line number Diff line number Diff line change @@ -350,23 +350,7 @@ private function shouldTestBeSkipped(array $sections, array $settings): bool
350
350
$ output = $ this ->runCodeInLocalSandbox ($ skipIfCode );
351
351
}
352
352
353
- if (str_contains ($ output , 'Parse error: ' )) {
354
- EventFacade::emitter ()->testRunnerTriggeredPhpunitWarning (
355
- sprintf (
356
- 'SKIPIF section triggered a parse error: %s ' ,
357
- $ output ,
358
- ),
359
- );
360
- }
361
-
362
- if (str_contains ($ output , 'Fatal error: ' )) {
363
- EventFacade::emitter ()->testRunnerTriggeredPhpunitWarning (
364
- sprintf (
365
- 'SKIPIF section triggered a fatal error: %s ' ,
366
- $ output ,
367
- ),
368
- );
369
- }
353
+ $ this ->triggerWarningOnPhpErrors ($ output );
370
354
371
355
if (strncasecmp ('skip ' , ltrim ($ output ), 4 ) === 0 ) {
372
356
$ message = '' ;
@@ -698,4 +682,25 @@ private function settings(bool $collectCoverage): array
698
682
699
683
return $ settings ;
700
684
}
685
+
686
+ private function triggerWarningOnPhpErrors (string $ output ): void
687
+ {
688
+ if (str_contains ($ output , 'Parse error: ' )) {
689
+ EventFacade::emitter ()->testRunnerTriggeredPhpunitWarning (
690
+ sprintf (
691
+ 'SKIPIF section triggered a parse error: %s ' ,
692
+ $ output ,
693
+ ),
694
+ );
695
+ }
696
+
697
+ if (str_contains ($ output , 'Fatal error: ' )) {
698
+ EventFacade::emitter ()->testRunnerTriggeredPhpunitWarning (
699
+ sprintf (
700
+ 'SKIPIF section triggered a fatal error: %s ' ,
701
+ $ output ,
702
+ ),
703
+ );
704
+ }
705
+ }
701
706
}
You can’t perform that action at this time.
0 commit comments