File tree Expand file tree Collapse file tree 1 file changed +16
-8
lines changed
Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -90,14 +90,7 @@ final class PhptTestCase implements SelfDescribing, Test
9090 */
9191 public function __construct (string $ filename , ?AbstractPhpProcess $ phpUtil = null )
9292 {
93- if (!is_file ($ filename )) {
94- throw new Exception (
95- sprintf (
96- 'File "%s" does not exist. ' ,
97- $ filename
98- )
99- );
100- }
93+ $ this ->ensureFileExists ($ filename );
10194
10295 $ this ->filename = $ filename ;
10396 $ this ->phpUtil = $ phpUtil ?: AbstractPhpProcess::factory ();
@@ -821,4 +814,19 @@ private function settings(bool $collectCoverage): array
821814
822815 return $ settings ;
823816 }
817+
818+ /**
819+ * @throws Exception
820+ */
821+ private function ensureFileExists (string $ filename ): void
822+ {
823+ if (!is_file ($ filename )) {
824+ throw new Exception (
825+ sprintf (
826+ 'File "%s" does not exist. ' ,
827+ $ filename
828+ )
829+ );
830+ }
831+ }
824832}
You can’t perform that action at this time.
0 commit comments