diff --git a/core/lib/Drupal/Core/Command/ServerCommand.php b/core/lib/Drupal/Core/Command/ServerCommand.php index f60325e8feb6..6c153241b2d9 100644 --- a/core/lib/Drupal/Core/Command/ServerCommand.php +++ b/core/lib/Drupal/Core/Command/ServerCommand.php @@ -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; } diff --git a/core/tests/Drupal/BuildTests/Framework/BuildTestBase.php b/core/tests/Drupal/BuildTests/Framework/BuildTestBase.php index 88e38fddf6f1..f484585dcbe4 100644 --- a/core/tests/Drupal/BuildTests/Framework/BuildTestBase.php +++ b/core/tests/Drupal/BuildTests/Framework/BuildTestBase.php @@ -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); diff --git a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/ExecTrait.php b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/ExecTrait.php index c0ff98edcbc9..be29f84561ca 100644 --- a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/ExecTrait.php +++ b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/ExecTrait.php @@ -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) { diff --git a/core/tests/Drupal/Tests/Core/Test/PhpUnitCliTest.php b/core/tests/Drupal/Tests/Core/Test/PhpUnitCliTest.php index 135302f6c64c..59a22c3bc993 100644 --- a/core/tests/Drupal/Tests/Core/Test/PhpUnitCliTest.php +++ b/core/tests/Drupal/Tests/Core/Test/PhpUnitCliTest.php @@ -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);