Issue #3162045 by andypost, ravi.shankar, catch, longwave: [Symfony 5] TypeError: Argument 1 passed to Symfony\Component\Process\Process::__construct() must be of the type array, string given
parent
0c30b0d61a
commit
59b936d051
|
@ -148,8 +148,8 @@ class ServerCommand extends Command {
|
|||
$url = escapeshellarg($url);
|
||||
}
|
||||
|
||||
$is_linux = (new Process('which xdg-open'))->run();
|
||||
$is_osx = (new Process('which open'))->run();
|
||||
$is_linux = Process::fromShellCommandline('which xdg-open')->run();
|
||||
$is_osx = Process::fromShellCommandline('which open')->run();
|
||||
if ($is_linux === 0) {
|
||||
$cmd = 'xdg-open ' . $url;
|
||||
}
|
||||
|
|
|
@ -311,7 +311,7 @@ abstract class BuildTestBase extends TestCase {
|
|||
* @return \Symfony\Component\Process\Process
|
||||
*/
|
||||
public function executeCommand($command_line, $working_dir = NULL) {
|
||||
$this->commandProcess = new Process($command_line);
|
||||
$this->commandProcess = Process::fromShellCommandline($command_line);
|
||||
$this->commandProcess->setWorkingDirectory($this->getWorkingPath($working_dir))
|
||||
->setTimeout(300)
|
||||
->setIdleTimeout(300);
|
||||
|
|
|
@ -23,7 +23,7 @@ trait ExecTrait {
|
|||
* Standard output from the command
|
||||
*/
|
||||
protected function mustExec($cmd, $cwd, array $env = []) {
|
||||
$process = new Process($cmd, $cwd, $env + ['PATH' => getenv('PATH'), 'HOME' => getenv('HOME')]);
|
||||
$process = Process::fromShellCommandline($cmd, $cwd, $env + ['PATH' => getenv('PATH'), 'HOME' => getenv('HOME')]);
|
||||
$process->setTimeout(300)->setIdleTimeout(300)->run();
|
||||
$exitCode = $process->getExitCode();
|
||||
if (0 != $exitCode) {
|
||||
|
|
|
@ -20,7 +20,7 @@ class PhpUnitCliTest extends UnitTestCase {
|
|||
// duplicate namespace errors or so forth. This keeps us from committing
|
||||
// tests which don't break under run-tests.sh, but do break under the
|
||||
// phpunit test runner tool.
|
||||
$process = new Process('vendor/bin/phpunit --configuration core --verbose --list-tests');
|
||||
$process = Process::fromShellCommandline('vendor/bin/phpunit --configuration core --verbose --list-tests');
|
||||
$process->setWorkingDirectory($this->root)
|
||||
->setTimeout(300)
|
||||
->setIdleTimeout(300);
|
||||
|
|
Loading…
Reference in New Issue