Skip to content

Commit

Permalink
Fix tetss on Drupal 10
Browse files Browse the repository at this point in the history
  • Loading branch information
weitzman committed Jan 30, 2022
1 parent 45b7989 commit ceef271
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/TestTraits/CliTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function getErrorOutputRaw()
/**
* Run a command and return the process without waiting for it to finish.
*
* @param string $command
* @param string|array $command
* The actual command line to run.
* @param sting cd
* The directory to run the command in.
Expand All @@ -88,12 +88,11 @@ public function getErrorOutputRaw()
* @param string $input
* A string representing the STDIN that is piped to the command.
*/
public function startExecute(string $command, $cd = null, $env = null, $input = null)
public function startExecute($command, $cd = null, $env = null, $input = null)
{
try {
// Process uses a default timeout of 60 seconds, set it to 0 (none).
$this->process = new Process($command, $cd, $env, $input, 0);
$this->process->inheritEnvironmentVariables(true);
if ($this->timeout) {
$this->process->setTimeout($this->timeout)
->setIdleTimeout($this->idleTimeout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ConfigSubscriber extends ConfigImportValidateEventSubscriberBase
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
public static function getSubscribedEvents(): array
{
$events = [];

Expand Down
5 changes: 3 additions & 2 deletions tests/unish/CommandUnishTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function getErrorOutputRaw()
public function drushBackground($command, array $args = [], array $options = [], $site_specification = null, $cd = null, $suffix = null, $env = [])
{
list($cmd, ) = $this->prepareDrushCommand($command, $args, $options, $site_specification, $suffix);
return $this->startExecute($cmd, $cd, $env);
return $this->startExecute(explode(' ', $cmd), $cd, $env);
}

/**
Expand Down Expand Up @@ -191,7 +191,8 @@ protected function prepareDrushCommand($command, array $args = [], array $option
if ($hide_stderr) {
$cmd[] = '2>' . $this->bitBucket();
}
$exec = array_filter($cmd, 'strlen'); // Remove NULLs
// Remove NULLs
$exec = @array_filter($cmd, 'strlen');
$cmd = implode(' ', $exec);
return [$cmd, $coverage_file];
}
Expand Down

0 comments on commit ceef271

Please sign in to comment.