/**
  * @test
  */
 public function it_loads_the_file()
 {
     $path = $this->get_fixture_path('env-basic');
     $env = new File($path);
     $this->assertTrue($env->isReadable());
     $this->assertTrue($env->isWritable());
 }
 /**
  * @param $env
  * @param $template
  */
 protected function init_from_template(File $env, $template)
 {
     if (!$env->isWritable()) {
         WP_CLI::error('Environment file is not readable at: ' . $env->path());
         return;
     }
     $template_path = $this->resolve_file_path($template);
     try {
         $env_template = File::at($template_path);
     } catch (\Exception $e) {
         WP_CLI::error("Template file is not readable at: {$template_path}");
     }
     WP_CLI::line('Initializing from template: ' . $env_template->path());
     copy($env_template->path(), $env->path());
     // we can't use WP-CLI --prompt because we're working off the template, not the synopsis
     if (!$this->get_flag('interactive')) {
         return;
     }
     $env->load();
     // reload the new copied data from template
     WP_CLI::line();
     WP_CLI::line('Interactive init');
     WP_CLI::line('Specify a new value for each key, or leave blank to keep the current value.');
     WP_CLI::line();
     $this->prompt_all($env);
 }