<?php

namespace Acquia\Blt\Tests;

use Symfony\Component\Yaml\Yaml;

/**
 * Tests BLT wizard command.
 */
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,
      '--no-interaction' => '',
    ]);

    $recipe = Yaml::parseFile($recipe_filepath);
    $project_configuration = Yaml::parseFile($this->sandboxInstance . '/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->sandboxInstance . '/acquia-pipelines.yaml');
  }

}
