diff --git a/src/Command/CodeStudio/CodeStudioWizardCommand.php b/src/Command/CodeStudio/CodeStudioWizardCommand.php index 87a1d0d75..c5524ea4f 100644 --- a/src/Command/CodeStudio/CodeStudioWizardCommand.php +++ b/src/Command/CodeStudio/CodeStudioWizardCommand.php @@ -49,7 +49,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int 'Node_project', ]; $projectSelected = $this->io->choice('Select a project type', $projectType, $projectType[0]); - echo "Selected project is, $projectSelected"; if ($projectSelected == 'Drupal_project') { $phpVersions = [ diff --git a/tests/phpunit/src/Commands/CodeStudio/CodeStudioPipelinesMigrateCommandTest.php b/tests/phpunit/src/Commands/CodeStudio/CodeStudioPipelinesMigrateCommandTest.php index 25d883f8d..1c03be2db 100644 --- a/tests/phpunit/src/Commands/CodeStudio/CodeStudioPipelinesMigrateCommandTest.php +++ b/tests/phpunit/src/Commands/CodeStudio/CodeStudioPipelinesMigrateCommandTest.php @@ -4,7 +4,6 @@ namespace Acquia\Cli\Tests\Commands\CodeStudio; -use Acquia\Cli\Command\CodeStudio\CodeStudioCiCdVariables; use Acquia\Cli\Command\CodeStudio\CodeStudioPipelinesMigrateCommand; use Acquia\Cli\Command\CommandBase; use Acquia\Cli\Tests\Commands\Ide\IdeRequiredTestTrait; @@ -92,7 +91,51 @@ public function testCommand(mixed $mockedGitlabProjects, mixed $inputs, mixed $a $this->mockRequest('getAccount'); $this->mockGitLabPermissionsRequest($this::$applicationUuid); $projects = $this->mockGetGitLabProjects($this::$applicationUuid, $this->gitLabProjectId, $mockedGitlabProjects); - $projects->variables($this->gitLabProjectId)->willReturn(CodeStudioCiCdVariables::getDefaultsForPhp()); + $gitlabCicdVariables = [ + [ + 'key' => 'ACQUIA_APPLICATION_UUID', + 'masked' => TRUE, + 'protected' => FALSE, + 'value' => NULL, + 'variable_type' => 'env_var', + ], + [ + 'key' => 'ACQUIA_CLOUD_API_TOKEN_KEY', + 'masked' => TRUE, + 'protected' => FALSE, + 'value' => NULL, + 'variable_type' => 'env_var', + ], + [ + 'key' => 'ACQUIA_CLOUD_API_TOKEN_SECRET', + 'masked' => TRUE, + 'protected' => FALSE, + 'value' => NULL, + 'variable_type' => 'env_var', + ], + [ + 'key' => 'ACQUIA_GLAB_TOKEN_NAME', + 'masked' => TRUE, + 'protected' => FALSE, + 'value' => NULL, + 'variable_type' => 'env_var', + ], + [ + 'key' => 'ACQUIA_GLAB_TOKEN_SECRET', + 'masked' => TRUE, + 'protected' => FALSE, + 'value' => NULL, + 'variable_type' => 'env_var', + ], + [ + 'key' => 'PHP_VERSION', + 'masked' => FALSE, + 'protected' => FALSE, + 'value' => NULL, + 'variable_type' => 'env_var', + ], + ]; + $projects->variables($this->gitLabProjectId)->willReturn($gitlabCicdVariables); $projects->update($this->gitLabProjectId, Argument::type('array')); $gitlabClient->projects()->willReturn($projects); $localMachineHelper->getFilesystem()->willReturn(new Filesystem())->shouldBeCalled(); diff --git a/tests/phpunit/src/Commands/CodeStudio/CodeStudioWizardCommandTest.php b/tests/phpunit/src/Commands/CodeStudio/CodeStudioWizardCommandTest.php index 40d475eaa..3b8480a65 100644 --- a/tests/phpunit/src/Commands/CodeStudio/CodeStudioWizardCommandTest.php +++ b/tests/phpunit/src/Commands/CodeStudio/CodeStudioWizardCommandTest.php @@ -157,6 +157,29 @@ public function providerTestCommand(): array { $this->key, // Enter Cloud secret, $this->secret, + // Select a project type Drupal_project + '0', + // Select PHP version 8.1 + '0', + // Do you want to continue? + 'y', + ], + // Args + [], + ], + [ + // No projects. + [], + // Inputs + [ + // 'Would you like to create a new Code Studio project? + 'y', + // Enter Cloud Key + $this->key, + // Enter Cloud secret, + $this->secret, + // Select a project type Node_project + '1', // Select PHP version 8.1 '0', // Do you want to continue? @@ -176,6 +199,29 @@ public function providerTestCommand(): array { $this->key, // Enter Cloud secret, $this->secret, + // Select a project type Drupal_project + '0', + // Select PHP version 8.2 + '1', + // Do you want to continue? + 'y', + ], + // Args + [], + ], + [ + // No projects. + [], + // Inputs + [ + // 'Would you like to create a new Code Studio project? + 'y', + // Enter Cloud Key + $this->key, + // Enter Cloud secret, + $this->secret, + // Select a project type Node_project + '1', // Select PHP version 8.2 '1', // Do you want to continue?