Skip to content

Commit

Permalink
TestCase: improve performance on Windows
Browse files Browse the repository at this point in the history
... by preventing a `cmd.exe` shell from being opened.
  • Loading branch information
jrfnl committed Feb 21, 2024
1 parent 290bcb6 commit 671bc51
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,12 @@ public static function executeCliCommand($command, $workingDir = null, $autoRetr
2 => array("pipe", "w"), // stderr
);

$process = proc_open($command, $descriptorspec, $pipes, $workingDir);
$options = null;
if (self::onWindows()) {
$options = array('bypass_shell' => true);
}

$process = proc_open($command, $descriptorspec, $pipes, $workingDir, null, $options);

if (is_resource($process) === false) {
throw new RuntimeException('Could not obtain a resource with proc_open() to execute the command.');
Expand Down

0 comments on commit 671bc51

Please sign in to comment.