Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / drush / drush / tests / InitCommandTest.php
1 <?php
2
3 namespace Unish;
4
5 /**
6  *  Test to see if the `drush init` command does the
7  *  setup that it is supposed to do.
8  *
9  *  @group base
10  */
11 class InitCommandCase extends CommandUnishTestCase
12 {
13
14     public function testInitCommand()
15     {
16         // Call `drush core-init`
17         $this->drush('core-init', [], ['add-path' => true, 'yes' => null, 'no-ansi' => null]);
18         $logOutput = $this->getErrorOutput();
19         // First test to ensure that the command claimed to have made the expected progress
20         $this->assertContains("Copied Drush bash customizations", $logOutput);
21         $this->assertContains("Updated bash configuration file", $logOutput);
22
23         // Next we test to see if there is evidence that those operations worked.
24         $home = getenv("HOME");
25         $this->assertFileExists("$home/.drush/drush.yml");
26         $this->assertFileExists("$home/.drush/drush.bashrc");
27         $this->assertFileExists("$home/.bashrc");
28
29         // Check to see if the .bashrc file sources our drush.bashrc file,
30         // and whether it adds the path to self::getDrush() to the $PATH
31         $bashrc_contents = file_get_contents("$home/.bashrc");
32         $this->assertContains('drush.bashrc', $bashrc_contents);
33
34         $this->assertContains(realpath(dirname(self::getDrush())), $bashrc_contents);
35     }
36 }