Skip to content

Commit

Permalink
Fixes acquia#2613: Resolve error in BLT wizard. Add tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
grasmash committed Mar 14, 2018
1 parent 741cfbf commit 99d2881
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Robo/Commands/Setup/WizardCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function wizard($options = [
}

if ($answers['vm']) {
$this->invokeCommand('vm', '--yes');
$this->invokeCommand('vm', ['--yes']);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Robo/Config/ProjectConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ProjectConfiguration implements ConfigurationInterface {

public function getConfigTreeBuilder() {
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('project');
$rootNode = $treeBuilder->root('recipe');

// @codingStandardsIgnoreStart
$rootNode
Expand Down
34 changes: 34 additions & 0 deletions tests/phpunit/BltProject/WizardTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

namespace Acquia\Blt\Tests\Blt;

use Acquia\Blt\Tests\BltProjectTestBase;
use Symfony\Component\Yaml\Yaml;

/**
* Class WizardTest.
*/
class WizardTest extends BltProjectTestBase {

/**
* Tests wizard with recipe file option
*/
public function testWizardUsingRecipe() {
$recipe_filepath = $this->bltDirectory . '/tests/phpunit/fixtures/recipe.yml';
$this->blt("wizard", [
'--recipe' => $recipe_filepath,
'--yes' => '',
]);

$recipe = Yaml::parseFile($recipe_filepath);
$project_configuration = Yaml::parseFile($this->bltDirectory . '/blt/blt.yml');

$this->assertEquals($recipe['human_name'], $project_configuration['project']['human_name']);
$this->assertEquals($recipe['machine_name'], $project_configuration['project']['machine_name']);
$this->assertEquals($recipe['prefix'], $project_configuration['project']['prefix']);
$this->assertEquals($recipe['human_name'], $project_configuration['project']['human_name']);
$this->assertFileExists($this->bltDirectory . '/acquia-pipelines');
$this->assertFileNotExists($this->bltDirectory . '/Vagrantfile');
}

}
7 changes: 7 additions & 0 deletions tests/phpunit/fixtures/recipe.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
human_name: "TEST PROJECT"
machine_name: TEST
profile: standard
prefix: TST
vm: false
ci:
provider: pipelines

0 comments on commit 99d2881

Please sign in to comment.