Skip to content

Commit

Permalink
Merge branch '8.x' into 9.x
Browse files Browse the repository at this point in the history
  • Loading branch information
crynobone committed Nov 22, 2024
2 parents 4af7e62 + 99ad9ac commit f02e658
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ function artisan(Contracts\TestCase|ApplicationContract $context, string $comman
*
* @param array<int, string>|string $command
* @param array<string, mixed>|string $env
* @param bool|null $tty
* @return \Symfony\Component\Process\Process
*/
function remote(array|string $command, array|string $env = []): Process
function remote(array|string $command, array|string $env = [], ?bool $tty = null): Process
{
$binary = \defined('TESTBENCH_DUSK') ? 'testbench-dusk' : 'testbench';

Expand All @@ -88,11 +89,17 @@ function remote(array|string $command, array|string $env = []): Process

Arr::add($env, 'TESTBENCH_PACKAGE_REMOTE', '(true)');

return Process::fromShellCommandline(
$process = Process::fromShellCommandline(
command: Arr::join([php_binary(true), $commander, ...Arr::wrap($command)], ' '),
cwd: package_path(),
env: array_merge(defined_environment_variables(), $env)
);

if (\is_bool($tty)) {
$process->setTty($tty);
}

return $process;
}

/**
Expand Down

0 comments on commit f02e658

Please sign in to comment.