6 * Test to see if the `drush init` command does the
7 * setup that it is supposed to do.
11 class initCommandCase extends CommandUnishTestCase {
13 function testInitCommand() {
14 // Call `drush core-init`
15 $this->drush('core-init', array(), array('backend' => NULL, 'add-path' => TRUE, 'yes' => NULL));
16 $parsed = $this->parse_backend_output($this->getOutput());
17 // First test to ensure that the command claimed to have made the expected progress
18 $this->assertLogHasMessage($parsed['log'], "Copied example Drush configuration file", 'ok');
19 $this->assertLogHasMessage($parsed['log'], "Copied example Drush bash configuration file", 'ok');
20 $this->assertLogHasMessage($parsed['log'], "Updated bash configuration file", 'ok');
21 // Next we will test to see if there is evidence that those
23 $home = getenv("HOME");
24 $this->assertFileExists("$home/.drush/drushrc.php");
25 $this->assertFileExists("$home/.drush/drush.bashrc");
26 $this->assertFileExists("$home/.bashrc");
28 // Check to see if the .bashrc file sources our drush.bashrc file,
29 // and whether it adds the path to UNISH_DRUSH to the $PATH
30 $bashrc_contents = file_get_contents("$home/.bashrc");
31 $this->assertContains('drush.bashrc', $bashrc_contents);
32 $this->assertContains(dirname(UNISH_DRUSH), $bashrc_contents);