diff --git a/src/Command/CodeStudio/CodeStudioWizardCommand.php b/src/Command/CodeStudio/CodeStudioWizardCommand.php index 337827a2c..81807fe01 100644 --- a/src/Command/CodeStudio/CodeStudioWizardCommand.php +++ b/src/Command/CodeStudio/CodeStudioWizardCommand.php @@ -114,11 +114,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int $projectAccessTokenName = 'acquia-codestudio'; $projectAccessToken = $this->createProjectAccessToken($project, $projectAccessTokenName); $this->updateGitLabProject($project); - if ($projectSelected == 'Drupal_project') { - $this->setGitLabCiCdVariablesForPhpProject($project, $appUuid, $cloudKey, $cloudSecret, $projectAccessTokenName, $projectAccessToken, $phpVersion); - } - elseif ($projectSelected == 'Node_project') { - $this->setGitLabCiCdVariablesForNodeProject($project, $appUuid, $cloudKey, $cloudSecret, $projectAccessTokenName, $projectAccessToken, $nodeVersion); + switch ($projectSelected) { + case "Drupal_project": + $this->setGitLabCiCdVariablesForPhpProject($project, $appUuid, $cloudKey, $cloudSecret, $projectAccessTokenName, $projectAccessToken, $phpVersion); + break; + case "Node_project": + $this->setGitLabCiCdVariablesForNodeProject($project, $appUuid, $cloudKey, $cloudSecret, $projectAccessTokenName, $projectAccessToken, $nodeVersion); + break; } $this->createScheduledPipeline($project); diff --git a/tests/phpunit/src/Commands/CodeStudio/CodeStudioWizardCommandTest.php b/tests/phpunit/src/Commands/CodeStudio/CodeStudioWizardCommandTest.php index 7fd83c528..865576678 100644 --- a/tests/phpunit/src/Commands/CodeStudio/CodeStudioWizardCommandTest.php +++ b/tests/phpunit/src/Commands/CodeStudio/CodeStudioWizardCommandTest.php @@ -95,6 +95,8 @@ public function providerTestCommand(): array { [ // 'Would you like to create a new Code Studio project? 'y', + // Select a project type Drupal_project + '0', // Select PHP version 8.1 '0', // Do you want to continue? @@ -115,6 +117,8 @@ public function providerTestCommand(): array { [ // 'Would you like to create a new Code Studio project? 'y', + // Select a project type Drupal_project + '0', // Select PHP version 8.2 '1', // Do you want to continue? @@ -128,6 +132,50 @@ public function providerTestCommand(): array { '--secret' => $this->secret, ], ], + [ + // No projects. + [], + // Inputs. + [ + // 'Would you like to create a new Code Studio project? + 'y', + // Select a project type Node_project + '1', + // Select NODE version 18.17.1 + '0', + // Do you want to continue? + 'y', + // Would you like to perform a one time push of code from Acquia Cloud to Code Studio now? (yes/no) [yes]: + 'y', + ], + // Args. + [ + '--key' => $this->key, + '--secret' => $this->secret, + ], + ], + [ + // No projects. + [], + // Inputs. + [ + // 'Would you like to create a new Code Studio project? + 'y', + // Select a project type Node_project + '1', + // Select NODE version 20.5.1 + '1', + // Do you want to continue? + 'y', + // Would you like to perform a one time push of code from Acquia Cloud to Code Studio now? (yes/no) [yes]: + 'y', + ], + // Args. + [ + '--key' => $this->key, + '--secret' => $this->secret, + ], + ], [ // No projects. [], @@ -180,7 +228,7 @@ public function providerTestCommand(): array { $this->secret, // Select a project type Node_project '1', - // Select PHP version 8.1 + // Select NODE version 18.17.1 '0', // Do you want to continue? 'y', @@ -222,7 +270,7 @@ public function providerTestCommand(): array { $this->secret, // Select a project type Node_project '1', - // Select PHP version 8.2 + // Select NODE version 20.5.1 '1', // Do you want to continue? 'y',