Skip to content

Commit

Permalink
GL-2753 : CS Wizard updated node version select values (#1767)
Browse files Browse the repository at this point in the history
* GL-2753 : CS Wizard updated node version select values

* undo style changes

* kill mutant

---------

Co-authored-by: Dane Powell <[email protected]>
  • Loading branch information
PrakharJainS3 and danepowell authored Jul 11, 2024
1 parent 285ba09 commit fded214
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 24 deletions.
6 changes: 3 additions & 3 deletions src/Command/CodeStudio/CodeStudioWizardCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand All @@ -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?
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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?
Expand All @@ -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,.
Expand All @@ -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',
Expand All @@ -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,.
Expand All @@ -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',
Expand Down Expand Up @@ -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',
];
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit fded214

Please sign in to comment.