diff --git a/src/Command/CodeStudio/CodeStudioWizardCommand.php b/src/Command/CodeStudio/CodeStudioWizardCommand.php index e49199bbd..8de74f368 100644 --- a/src/Command/CodeStudio/CodeStudioWizardCommand.php +++ b/src/Command/CodeStudio/CodeStudioWizardCommand.php @@ -62,10 +62,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int break; case "Node_project": $nodeVersions = [ - 'NODE_version_18.17.1' => "18.17.1", - 'NODE_version_20.5.1' => "20.5.1", + 'NODE_version_18' => "18", + 'NODE_version_20' => "20", ]; - $project = $this->io->choice('Select a NODE version', array_values($nodeVersions), "18.17.1"); + $project = $this->io->choice('Select a NODE version', array_values($nodeVersions), "20"); $project = array_search($project, $nodeVersions, true); $nodeVersion = $nodeVersions[$project]; break; diff --git a/tests/phpunit/src/Commands/CodeStudio/CodeStudioWizardCommandTest.php b/tests/phpunit/src/Commands/CodeStudio/CodeStudioWizardCommandTest.php index a2d4b6993..af42d76f9 100644 --- a/tests/phpunit/src/Commands/CodeStudio/CodeStudioWizardCommandTest.php +++ b/tests/phpunit/src/Commands/CodeStudio/CodeStudioWizardCommandTest.php @@ -65,6 +65,8 @@ public function providerTestCommand(): array [$this->getMockedGitLabProject($this->gitLabProjectId)], // Inputs. [ + 0, + 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]: @@ -84,6 +86,9 @@ public function providerTestCommand(): array ], // Inputs. [ + 0, + 0, + 'n', // Found multiple projects that could match the Sample application 1 application. Choose which one to configure. '0', // Do you want to continue? @@ -102,6 +107,8 @@ public function providerTestCommand(): array [], // Inputs. [ + 0, + 0, // 'Would you like to create a new Code Studio project? 'y', // Select a project type Drupal_project. @@ -124,8 +131,6 @@ public function providerTestCommand(): array [], // Inputs. [ - // 'Would you like to create a new Code Studio project? - 'y', // Select a project type Drupal_project. '0', // Select PHP version 8.2. @@ -146,11 +151,9 @@ public function providerTestCommand(): array [], // 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. + // Select NODE version 18. '0', // Do you want to continue? 'y', @@ -168,11 +171,9 @@ public function providerTestCommand(): array [], // 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. + // Select NODE version 20. '1', // Do you want to continue? 'y', @@ -190,8 +191,10 @@ public function providerTestCommand(): array [], // Inputs. [ - // 'Would you like to create a new Code Studio project? - 'n', + 0, + 0, + 'y', + 'y', // Choose project. '0', // Do you want to continue? @@ -208,8 +211,6 @@ public function providerTestCommand(): array [], // Inputs. [ - // 'Would you like to create a new Code Studio project? - 'y', // Enter Cloud Key. $this->key, // Enter Cloud secret,. @@ -229,15 +230,13 @@ public function providerTestCommand(): array [], // 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 NODE version 18.17.1. + // Select NODE version 18. '0', // Do you want to continue? 'y', @@ -250,8 +249,6 @@ public function providerTestCommand(): array [], // Inputs. [ - // 'Would you like to create a new Code Studio project? - 'y', // Enter Cloud Key. $this->key, // Enter Cloud secret,. @@ -271,15 +268,13 @@ public function providerTestCommand(): array [], // 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 NODE version 20.5.1. + // Select NODE version 20. '1', // Do you want to continue? 'y', @@ -332,7 +327,7 @@ public function testCommand(array $mockedGitlabProjects, array $inputs, array $a )->shouldBeCalled(); $this->mockGitLabVariables($this->gitLabProjectId, $projects); - if ($inputs[0] === 'y' && ($inputs[1] === '1' || (array_key_exists(3, $inputs) && $inputs[3] === '1'))) { + if (($inputs[0] === '1' || (array_key_exists(2, $inputs) && $inputs[2] === '1'))) { $parameters = [ 'ci_config_path' => 'gitlab-ci/Auto-DevOps.acquia.gitlab-ci.yml@acquia/node-template', ]; @@ -387,6 +382,7 @@ public function testCommand(array $mockedGitlabProjects, array $inputs, array $a foreach ($output_strings as $output_string) { self::assertStringContainsString($output_string, $output); } + self::assertStringNotContainsString('[ERROR]', $output); // Assertions. $this->assertEquals(0, $this->getStatusCode());