@@ -952,8 +952,7 @@ function lime_shutdown()
952
952
);
953
953
954
954
ob_start ();
955
- // see http://trac.symfony-project.org/ticket/5437 for the explanation on the weird "cd" thing
956
- passthru (sprintf ('cd & %s %s 2>&1 ' , escapeshellarg ($ this ->php_cli ), escapeshellarg ($ test_file )), $ return );
955
+ $ return = $ this ->executePhpFile ($ test_file );
957
956
ob_end_clean ();
958
957
unlink ($ test_file );
959
958
@@ -1123,6 +1122,20 @@ public function get_failed_files()
1123
1122
{
1124
1123
return isset ($ this ->stats ['failed_files ' ]) ? $ this ->stats ['failed_files ' ] : array ();
1125
1124
}
1125
+
1126
+ /**
1127
+ * The command fails if the path to php interpreter contains spaces.
1128
+ * The only workaround is adding a "nop" command call before the quoted command.
1129
+ * The weird "cd &".
1130
+ *
1131
+ * see http://trac.symfony-project.org/ticket/5437
1132
+ */
1133
+ public function executePhpFile (string $ phpFile ): int
1134
+ {
1135
+ passthru (sprintf ('cd & %s %s 2>&1 ' , escapeshellarg ($ this ->php_cli ), escapeshellarg ($ phpFile )), $ return );
1136
+
1137
+ return $ return ;
1138
+ }
1126
1139
}
1127
1140
1128
1141
class lime_coverage extends lime_registration
@@ -1186,8 +1199,7 @@ public function process($files)
1186
1199
EOF ;
1187
1200
file_put_contents ($ tmp_file , $ tmp );
1188
1201
ob_start ();
1189
- // see http://trac.symfony-project.org/ticket/5437 for the explanation on the weird "cd" thing
1190
- passthru (sprintf ('cd & %s %s 2>&1 ' , escapeshellarg ($ this ->harness ->php_cli ), escapeshellarg ($ tmp_file )), $ return );
1202
+ $ return = $ this ->harness ->executePhpFile ($ tmp_file );
1191
1203
$ retval = ob_get_clean ();
1192
1204
1193
1205
if (0 != $ return ) // test exited without success
0 commit comments