diff --git a/.phpstorm.meta.php b/.phpstorm.meta.php index d49f754b9..23883cf97 100644 --- a/.phpstorm.meta.php +++ b/.phpstorm.meta.php @@ -5,6 +5,7 @@ use AcquiaCloudApi\Response\ApplicationResponse; use AcquiaCloudApi\Response\ApplicationsResponse; use AcquiaCloudApi\Response\DatabasesResponse; + use AcquiaCloudApi\Response\EnvironmentResponse; use AcquiaCloudApi\Response\EnvironmentsResponse; override(\Acquia\Cli\Tests\TestBase::mockRequest(), map([ @@ -12,7 +13,8 @@ 'getApplications' => ApplicationsResponse::class, 'getApplicationByUuid' => ApplicationResponse::class, 'getApplicationEnvironments' => EnvironmentsResponse::class, - 'getEnvironmentsDatabases' => DatabasesResponse::class + 'getEnvironmentsDatabases' => DatabasesResponse::class, + 'getEnvironment' => EnvironmentResponse::class ])); } diff --git a/src/Command/App/LogTailCommand.php b/src/Command/App/LogTailCommand.php index 05d5c13f8..543d70040 100644 --- a/src/Command/App/LogTailCommand.php +++ b/src/Command/App/LogTailCommand.php @@ -47,14 +47,14 @@ protected function configure(): void { } protected function execute(InputInterface $input, OutputInterface $output): int { - $environmentId = $this->determineCloudEnvironment(); + $environment = $this->determineEnvironment($input, $output); $acquiaCloudClient = $this->cloudApiClientService->getClient(); $logs = $this->promptChooseLogs(); $logTypes = array_map(static function (mixed $log) { return $log['type']; }, $logs); $logsResource = new Logs($acquiaCloudClient); - $stream = $logsResource->stream($environmentId); + $stream = $logsResource->stream($environment->uuid); $this->logstreamManager->setParams($stream->logstream->params); $this->logstreamManager->setColourise(TRUE); $this->logstreamManager->setLogTypeFilter($logTypes); diff --git a/src/Command/CodeStudio/CodeStudioWizardCommand.php b/src/Command/CodeStudio/CodeStudioWizardCommand.php index 52675b696..e8f7d479d 100644 --- a/src/Command/CodeStudio/CodeStudioWizardCommand.php +++ b/src/Command/CodeStudio/CodeStudioWizardCommand.php @@ -15,7 +15,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -#[AsCommand(name: 'codestudio:wizard', description: 'Create and/or configure a new Code Studio project for a given Acquia Cloud application', aliases: ['cs:wizard'])] +#[AsCommand(name: 'codestudio:wizard', description: 'Create and/or configure a new Code Studio project for a given Cloud Platform application', aliases: ['cs:wizard'])] final class CodeStudioWizardCommand extends WizardCommandBase { use CodeStudioCommandTrait; diff --git a/src/Command/CommandBase.php b/src/Command/CommandBase.php index 4228cefb6..0bcb5bb0a 100644 --- a/src/Command/CommandBase.php +++ b/src/Command/CommandBase.php @@ -56,7 +56,6 @@ use stdClass; use Symfony\Component\Cache\Adapter\FilesystemAdapter; use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Exception\RuntimeException; use Symfony\Component\Console\Helper\FormatterHelper; use Symfony\Component\Console\Helper\ProgressBar; use Symfony\Component\Console\Helper\Table; @@ -475,9 +474,10 @@ protected function rsyncFiles(string $sourceDir, string $destinationDir, ?callab } protected function getCloudFilesDir(EnvironmentResponse $chosenEnvironment, string $site): string { - $sitegroup = self::getSiteGroupFromSshUrl($chosenEnvironment->sshUrl); + $sitegroup = self::getSitegroup($chosenEnvironment); + $envAlias = self::getEnvironmentAlias($chosenEnvironment); if ($this->isAcsfEnv($chosenEnvironment)) { - return '/mnt/files/' . $sitegroup . '.' . $chosenEnvironment->name . '/sites/g/files/' . $site . '/files'; + return "/mnt/files/$envAlias/sites/g/files/$site/files"; } return $this->getCloudSitesPath($chosenEnvironment, $sitegroup) . "/$site/files"; } @@ -502,7 +502,7 @@ protected function determineCloudDatabases(Client $acquiaCloudClient, Environmen if ($site && !$multipleDbs) { if ($site === 'default') { $this->logger->debug('Site is set to default. Assuming default database'); - $site = self::getSiteGroupFromSshUrl($chosenEnvironment->sshUrl); + $site = self::getSitegroup($chosenEnvironment); } $databaseNames = array_column((array) $databases, 'name'); $databaseKey = array_search($site, $databaseNames, TRUE); @@ -776,28 +776,6 @@ protected function inferCloudAppFromLocalGitConfig( return NULL; } - /** - * Determine the Cloud environment. - * - * @return string The environment UUID. - */ - protected function determineCloudEnvironment(): string { - if ($this->input->hasArgument('environmentId') && $this->input->getArgument('environmentId')) { - return $this->input->getArgument('environmentId'); - } - - if (!$this->input->isInteractive()) { - throw new RuntimeException('Not enough arguments (missing: "environmentId").'); - } - - $applicationUuid = $this->determineCloudApplication(); - $acquiaCloudClient = $this->cloudApiClientService->getClient(); - /** @var EnvironmentResponse $environment */ - $environment = $this->promptChooseEnvironment($acquiaCloudClient, $applicationUuid); - - return $environment->uuid; - } - /** * @return array */ @@ -1316,12 +1294,13 @@ protected function convertNotificationToUuid(InputInterface $input, string $argu } } - /** - * @param string $sshUrl The SSH URL to the server. - * @return string The sitegroup. E.g., eemgrasmick. - */ - public static function getSiteGroupFromSshUrl(string $sshUrl): string { - $sshUrlParts = explode('.', $sshUrl); + public static function getSitegroup(EnvironmentResponse $environment): string { + $sshUrlParts = explode('.', $environment->sshUrl); + return reset($sshUrlParts); + } + + public static function getEnvironmentAlias(EnvironmentResponse $environment): string { + $sshUrlParts = explode('@', $environment->sshUrl); return reset($sshUrlParts); } @@ -1342,8 +1321,8 @@ protected function isAcsfEnv(mixed $cloudEnvironment): bool { * @return array */ protected function getAcsfSites(EnvironmentResponse $cloudEnvironment): array { - $sitegroup = self::getSiteGroupFromSshUrl($cloudEnvironment->sshUrl); - $command = ['cat', "/var/www/site-php/$sitegroup.{$cloudEnvironment->name}/multisite-config.json"]; + $envAlias = self::getEnvironmentAlias($cloudEnvironment); + $command = ['cat', "/var/www/site-php/$envAlias/multisite-config.json"]; $process = $this->sshHelper->executeCommand($cloudEnvironment, $command, FALSE); if ($process->isSuccessful()) { return json_decode($process->getOutput(), TRUE, 512, JSON_THROW_ON_ERROR); @@ -1355,7 +1334,7 @@ protected function getAcsfSites(EnvironmentResponse $cloudEnvironment): array { * @return array */ private function getCloudSites(EnvironmentResponse $cloudEnvironment): array { - $sitegroup = self::getSiteGroupFromSshUrl($cloudEnvironment->sshUrl); + $sitegroup = self::getSitegroup($cloudEnvironment); $command = ['ls', $this->getCloudSitesPath($cloudEnvironment, $sitegroup)]; $process = $this->sshHelper->executeCommand($cloudEnvironment, $command, FALSE); $sites = array_filter(explode("\n", trim($process->getOutput()))); diff --git a/src/Command/Env/EnvCertCreateCommand.php b/src/Command/Env/EnvCertCreateCommand.php index bb3c1b8c4..c1f32f717 100644 --- a/src/Command/Env/EnvCertCreateCommand.php +++ b/src/Command/Env/EnvCertCreateCommand.php @@ -31,7 +31,7 @@ protected function configure(): void { protected function execute(InputInterface $input, OutputInterface $output): int { $acquiaCloudClient = $this->cloudApiClientService->getClient(); - $envUuid = $this->determineCloudEnvironment(); + $environment = $this->determineEnvironment($input, $output); $certificate = $input->getArgument('certificate'); $privateKey = $input->getArgument('private-key'); $label = $this->determineOption('label'); @@ -42,7 +42,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $sslCertificates = new SslCertificates($acquiaCloudClient); $response = $sslCertificates->create( - $envUuid, + $environment->uuid, $label, $this->localMachineHelper->readFile($certificate), $this->localMachineHelper->readFile($privateKey), diff --git a/src/Command/Env/EnvCopyCronCommand.php b/src/Command/Env/EnvCopyCronCommand.php index d1a5a8df8..1f018d268 100644 --- a/src/Command/Env/EnvCopyCronCommand.php +++ b/src/Command/Env/EnvCopyCronCommand.php @@ -15,7 +15,7 @@ use Symfony\Component\Console\Output\OutputInterface; #[RequireAuth] -#[AsCommand(name: 'env:cron-copy', description: 'Copy all cron tasks from one Acquia Cloud Platform environment to another')] +#[AsCommand(name: 'env:cron-copy', description: 'Copy all cron tasks from one Cloud Platform environment to another')] final class EnvCopyCronCommand extends CommandBase { protected function configure(): void { diff --git a/src/Command/Push/PushDatabaseCommand.php b/src/Command/Push/PushDatabaseCommand.php index f169aa428..d3b2363a1 100644 --- a/src/Command/Push/PushDatabaseCommand.php +++ b/src/Command/Push/PushDatabaseCommand.php @@ -60,8 +60,8 @@ private function uploadDatabaseDump( string $localFilepath, callable $outputCallback ): string { - $sitegroup = self::getSiteGroupFromSshUrl($environment->sshUrl); - $remoteFilepath = "/mnt/tmp/{$sitegroup}.{$environment->name}/" . basename($localFilepath); + $envAlias = self::getEnvironmentAlias($environment); + $remoteFilepath = "/mnt/tmp/$envAlias/" . basename($localFilepath); $this->logger->debug("Uploading database dump to $remoteFilepath on remote machine"); $this->localMachineHelper->checkRequiredBinariesExist(['rsync']); $command = [ diff --git a/src/Command/Remote/DrushCommand.php b/src/Command/Remote/DrushCommand.php index 6a3761fa2..eb8a0eca6 100644 --- a/src/Command/Remote/DrushCommand.php +++ b/src/Command/Remote/DrushCommand.php @@ -14,13 +14,13 @@ * A command to proxy Drush commands on an environment using SSH. */ #[RequireAuth] -#[AsCommand(name: 'remote:drush', description: 'Run a Drush command remotely on a application\'s environment', aliases: ['drush', 'dr'])] +#[AsCommand(name: 'remote:drush', description: 'Run a Drush command remotely on a Cloud Platform environment', aliases: ['drush', 'dr'])] final class DrushCommand extends SshBaseCommand { protected function configure(): void { $this ->setHelp('Pay close attention to the argument syntax! Note the usage of -- to separate the drush command arguments and options.') - ->addArgument('alias', InputArgument::REQUIRED, 'Alias for application & environment in the format `app-name.env`') + ->acceptEnvironmentId() ->addArgument('drush_command', InputArgument::IS_ARRAY, 'Drush command') ->addUsage('. -- ') ->addUsage('myapp.dev -- uli 1') @@ -28,14 +28,11 @@ protected function configure(): void { } protected function execute(InputInterface $input, OutputInterface $output): ?int { - $alias = $input->getArgument('alias'); - $alias = $this->normalizeAlias($alias); - $alias = self::validateEnvironmentAlias($alias); - $environment = $this->getEnvironmentFromAliasArg($alias); - + $environment = $this->determineEnvironment($input, $output); + $alias = self::getEnvironmentAlias($environment); $acliArguments = $input->getArguments(); $drushCommandArguments = [ - "cd /var/www/html/{$alias}/docroot; ", + "cd /var/www/html/$alias/docroot; ", 'drush', implode(' ', (array) $acliArguments['drush_command']), ]; diff --git a/tests/phpunit/src/Application/ExceptionApplicationTest.php b/tests/phpunit/src/Application/ExceptionApplicationTest.php index 3fe3fd836..22268c31c 100644 --- a/tests/phpunit/src/Application/ExceptionApplicationTest.php +++ b/tests/phpunit/src/Application/ExceptionApplicationTest.php @@ -101,17 +101,6 @@ public function testNoAvailableIdes(): void { self::assertStringContainsString('Delete an existing IDE', $buffer); } - /** - * @group serial - */ - public function testMissingEnvironmentUuid(): void { - $this->setInput([ - 'command' => 'log:tail', - ]); - $buffer = $this->runApp(); - self::assertStringContainsString('can also be a site alias.', $buffer); - } - /** * @group serial */ diff --git a/tests/phpunit/src/Application/KernelTest.php b/tests/phpunit/src/Application/KernelTest.php index 5543b8b53..2b458cd4a 100644 --- a/tests/phpunit/src/Application/KernelTest.php +++ b/tests/phpunit/src/Application/KernelTest.php @@ -68,14 +68,14 @@ private function getEnd(): string { auth:logout [logout] Remove Cloud Platform API credentials codestudio codestudio:php-version Change the PHP version in Code Studio - codestudio:wizard [cs:wizard] Create and/or configure a new Code Studio project for a given Acquia Cloud application + codestudio:wizard [cs:wizard] Create and/or configure a new Code Studio project for a given Cloud Platform application email email:configure [ec] Configure Platform email for one or more applications email:info Print information related to Platform Email set up in a subscription. env env:certificate-create Install an SSL certificate. env:create Create a new Continuous Delivery Environment (CDE) - env:cron-copy Copy all cron tasks from one Acquia Cloud Platform environment to another + env:cron-copy Copy all cron tasks from one Cloud Platform environment to another env:delete Delete a Continuous Delivery Environment (CDE) env:mirror Makes one environment identical to another in terms of code, database, files, and configuration. ide @@ -98,7 +98,7 @@ private function getEnd(): string { remote remote:aliases:download Download Drush aliases for the Cloud Platform remote:aliases:list [aliases|sa] List all aliases for the Cloud Platform environments - remote:drush [drush|dr] Run a Drush command remotely on a application's environment + remote:drush [drush|dr] Run a Drush command remotely on a Cloud Platform environment remote:ssh [ssh] Use SSH to open a shell or run a command in a Cloud Platform environment self self:clear-caches [cc|cr] Clears local Acquia CLI caches diff --git a/tests/phpunit/src/CommandTestBase.php b/tests/phpunit/src/CommandTestBase.php index 59454888c..5fb2eebde 100644 --- a/tests/phpunit/src/CommandTestBase.php +++ b/tests/phpunit/src/CommandTestBase.php @@ -265,7 +265,7 @@ protected function mockGetAcsfSites(mixed $sshHelper): array { $acsfMultisiteFetchProcess->getOutput()->willReturn($multisiteConfig)->shouldBeCalled(); $sshHelper->executeCommand( Argument::type('object'), - ['cat', '/var/www/site-php/profserv2.dev/multisite-config.json'], + ['cat', '/var/www/site-php/profserv2.01dev/multisite-config.json'], FALSE )->willReturn($acsfMultisiteFetchProcess->reveal())->shouldBeCalled(); return json_decode($multisiteConfig, TRUE); @@ -274,7 +274,8 @@ protected function mockGetAcsfSites(mixed $sshHelper): array { protected function mockGetCloudSites(mixed $sshHelper, mixed $environment): void { $cloudMultisiteFetchProcess = $this->mockProcess(); $cloudMultisiteFetchProcess->getOutput()->willReturn("\nbar\ndefault\nfoo\n")->shouldBeCalled(); - $sitegroup = CommandBase::getSiteGroupFromSshUrl($environment->ssh_url); + $parts = explode('.', $environment->ssh_url); + $sitegroup = reset($parts); $sshHelper->executeCommand( Argument::type('object'), ['ls', "/mnt/files/$sitegroup.{$environment->name}/sites"], diff --git a/tests/phpunit/src/Commands/App/LogTailCommandTest.php b/tests/phpunit/src/Commands/App/LogTailCommandTest.php index b78614eb1..ad8b0dfaa 100644 --- a/tests/phpunit/src/Commands/App/LogTailCommandTest.php +++ b/tests/phpunit/src/Commands/App/LogTailCommandTest.php @@ -62,6 +62,7 @@ public function testLogTailCommand(): void { } public function testLogTailCommandWithEnvArg(): void { + $this->mockRequest('getEnvironment', '24-a47ac10b-58cc-4372-a567-0e02b2c3d470'); $this->mockLogStreamRequest(); $this->executeCommand( ['environmentId' => '24-a47ac10b-58cc-4372-a567-0e02b2c3d470'], diff --git a/tests/phpunit/src/Commands/Pull/PullDatabaseCommandTest.php b/tests/phpunit/src/Commands/Pull/PullDatabaseCommandTest.php index 9547dc546..e2f209cfa 100644 --- a/tests/phpunit/src/Commands/Pull/PullDatabaseCommandTest.php +++ b/tests/phpunit/src/Commands/Pull/PullDatabaseCommandTest.php @@ -413,7 +413,7 @@ protected function mockExecuteMySqlImport( } protected function mockDownloadMySqlDump(ObjectProphecy $localMachineHelper, mixed $success): void { - $process = $this->mockProcess($success); + $this->mockProcess($success); $localMachineHelper->writeFile( Argument::containingString("dev-profserv2-profserv201dev-something.sql.gz"), 'backupfilecontents' diff --git a/tests/phpunit/src/Commands/Pull/PullFilesCommandTest.php b/tests/phpunit/src/Commands/Pull/PullFilesCommandTest.php index 5ff6dc14b..4c8fffdc7 100644 --- a/tests/phpunit/src/Commands/Pull/PullFilesCommandTest.php +++ b/tests/phpunit/src/Commands/Pull/PullFilesCommandTest.php @@ -42,7 +42,7 @@ public function testRefreshAcsfFiles(): void { $this->mockGetAcsfSites($sshHelper); $localMachineHelper = $this->mockLocalMachineHelper(); $this->mockGetFilesystem($localMachineHelper); - $this->mockExecuteRsync($localMachineHelper, $selectedEnvironment, '/mnt/files/profserv2.dev/sites/g/files/jxr5000596dev/files/', $this->projectDir . '/docroot/sites/jxr5000596dev/files'); + $this->mockExecuteRsync($localMachineHelper, $selectedEnvironment, '/mnt/files/profserv2.01dev/sites/g/files/jxr5000596dev/files/', $this->projectDir . '/docroot/sites/jxr5000596dev/files'); $this->command->sshHelper = $sshHelper->reveal(); @@ -78,7 +78,8 @@ public function testRefreshCloudFiles(): void { $this->mockGetCloudSites($sshHelper, $selectedEnvironment); $localMachineHelper = $this->mockLocalMachineHelper(); $this->mockGetFilesystem($localMachineHelper); - $sitegroup = CommandBase::getSiteGroupFromSshUrl($selectedEnvironment->ssh_url); + $parts = explode('.', $selectedEnvironment->ssh_url); + $sitegroup = reset($parts); $this->mockExecuteRsync($localMachineHelper, $selectedEnvironment, '/mnt/files/' . $sitegroup . '.' . $selectedEnvironment->name . '/sites/bar/files/', $this->projectDir . '/docroot/sites/bar/files'); $this->command->sshHelper = $sshHelper->reveal(); diff --git a/tests/phpunit/src/Commands/Push/PushDatabaseCommandTest.php b/tests/phpunit/src/Commands/Push/PushDatabaseCommandTest.php index f3d3e5b0a..974d725af 100644 --- a/tests/phpunit/src/Commands/Push/PushDatabaseCommandTest.php +++ b/tests/phpunit/src/Commands/Push/PushDatabaseCommandTest.php @@ -85,7 +85,7 @@ protected function mockUploadDatabaseDump( '-tDvPhe', 'ssh -o StrictHostKeyChecking=no', sys_get_temp_dir() . '/acli-mysql-dump-drupal.sql.gz', - 'profserv2.01dev@profserv201dev.ssh.enterprise-g1.acquia-sites.com:/mnt/tmp/profserv2.dev/acli-mysql-dump-drupal.sql.gz', + 'profserv2.01dev@profserv201dev.ssh.enterprise-g1.acquia-sites.com:/mnt/tmp/profserv2.01dev/acli-mysql-dump-drupal.sql.gz', ]; $localMachineHelper->execute($command, Argument::type('callable'), NULL, TRUE, NULL) ->willReturn($process->reveal()) @@ -99,7 +99,7 @@ protected function mockImportDatabaseDumpOnRemote( ): void { $sshHelper->executeCommand( new EnvironmentResponse($environmentsResponse), - ['pv /mnt/tmp/profserv2.dev/acli-mysql-dump-drupal.sql.gz --bytes --rate | gunzip | MYSQL_PWD=password mysql --host=fsdb-74.enterprise-g1.hosting.acquia.com.enterprise-g1.hosting.acquia.com --user=s164 profserv2db14390'], + ['pv /mnt/tmp/profserv2.01dev/acli-mysql-dump-drupal.sql.gz --bytes --rate | gunzip | MYSQL_PWD=password mysql --host=fsdb-74.enterprise-g1.hosting.acquia.com.enterprise-g1.hosting.acquia.com --user=s164 profserv2db14390'], TRUE, NULL ) diff --git a/tests/phpunit/src/Commands/Push/PushFilesCommandTest.php b/tests/phpunit/src/Commands/Push/PushFilesCommandTest.php index f4767f6ea..48135b464 100644 --- a/tests/phpunit/src/Commands/Push/PushFilesCommandTest.php +++ b/tests/phpunit/src/Commands/Push/PushFilesCommandTest.php @@ -134,7 +134,8 @@ protected function mockExecuteCloudRsync( mixed $environment ): void { $localMachineHelper->checkRequiredBinariesExist(['rsync'])->shouldBeCalled(); - $sitegroup = CommandBase::getSiteGroupFromSshUrl($environment->ssh_url); + $parts = explode('.', $environment->ssh_url); + $sitegroup = reset($parts); $command = [ 'rsync', '-avPhze', @@ -158,7 +159,7 @@ protected function mockExecuteAcsfRsync( '-avPhze', 'ssh -o StrictHostKeyChecking=no', $this->projectDir . '/docroot/sites/' . $site . '/files/', - 'profserv2.01dev@profserv201dev.ssh.enterprise-g1.acquia-sites.com:/mnt/files/profserv2.dev/sites/g/files/' . $site . '/files', + 'profserv2.01dev@profserv201dev.ssh.enterprise-g1.acquia-sites.com:/mnt/files/profserv2.01dev/sites/g/files/' . $site . '/files', ]; $localMachineHelper->execute($command, Argument::type('callable'), NULL, TRUE) ->willReturn($process->reveal()) diff --git a/tests/phpunit/src/Commands/Remote/DrushCommandTest.php b/tests/phpunit/src/Commands/Remote/DrushCommandTest.php index 83ac85907..d70e7b246 100644 --- a/tests/phpunit/src/Commands/Remote/DrushCommandTest.php +++ b/tests/phpunit/src/Commands/Remote/DrushCommandTest.php @@ -6,7 +6,6 @@ use Acquia\Cli\Command\CommandBase; use Acquia\Cli\Command\Remote\DrushCommand; -use Acquia\Cli\Command\Self\ClearCacheCommand; use Acquia\Cli\Helpers\SshHelper; use Prophecy\Argument; @@ -27,14 +26,12 @@ public function providerTestRemoteDrushCommand(): array { [ [ '-vvv' => '', - 'alias' => 'devcloud2.dev', 'drush_command' => 'status --fields=db-status', ], ], [ [ '-vvv' => '', - 'alias' => '@devcloud2.dev', 'drush_command' => 'status --fields=db-status', ], ], @@ -47,8 +44,7 @@ public function providerTestRemoteDrushCommand(): array { * @group serial */ public function testRemoteDrushCommand(array $args): void { - ClearCacheCommand::clearCaches(); - $this->mockForGetEnvironmentFromAliasArg(); + $this->mockGetEnvironment(); [$process, $localMachineHelper] = $this->mockForExecuteCommand(); $localMachineHelper->checkRequiredBinariesExist(['ssh'])->shouldBeCalled(); $sshCommand = [ @@ -58,7 +54,7 @@ public function testRemoteDrushCommand(array $args): void { '-o StrictHostKeyChecking=no', '-o AddressFamily inet', '-o LogLevel=ERROR', - 'cd /var/www/html/devcloud2.dev/docroot; ', + 'cd /var/www/html/site.dev/docroot; ', 'drush', 'status --fields=db-status', ]; @@ -68,7 +64,7 @@ public function testRemoteDrushCommand(array $args): void { ->shouldBeCalled(); $this->command->sshHelper = new SshHelper($this->output, $localMachineHelper->reveal(), $this->logger); - $this->executeCommand($args); + $this->executeCommand($args, self::inputChooseEnvironment()); // Assert.