function coreCase::testDrupalDirectory

8.0.x coreTest.php coreCase::testDrupalDirectory()
6.x coreTest.php coreCase::testDrupalDirectory()
7.x coreTest.php coreCase::testDrupalDirectory()
4.x coreTest.php coreCase::testDrupalDirectory()
5.x coreTest.php coreCase::testDrupalDirectory()
master coreTest.php coreCase::testDrupalDirectory()

File

tests/coreTest.php, line 92

Namespace

Unish

Class

coreCase
Tests for core commands.

Code

function testDrupalDirectory() {
  $root = $this->webroot();
  $sitewide = $this->drupalSitewideDirectory();
  $options = array(
    'root' => $root,
    'uri' => key($this->getSites()),
    'yes' => NULL,
    'skip' => NULL,
    'cache' => NULL,
    'strict' => 0, // invoke from script: do not verify options
  );
  $this->drush('drupal-directory', array('%files'), $options);
  $output = $this->getOutput();
  $this->assertEquals($root . '/sites/dev/files', $output);

  $this->drush('drupal-directory', array('%modules'), $options);
  $output = $this->getOutput();
  $this->assertEquals($root . $sitewide . '/modules', $output);

  $this->drush('pm-download', array('devel'), $options);
  $this->drush('pm-enable', array('devel'), $options);
  $this->drush('pm-download', array('empty_theme'), $options);

  $this->drush('drupal-directory', array('devel'), $options);
  $output = $this->getOutput();
  $this->assertEquals(realpath($root . $sitewide . '/modules/devel'), $output);

  $this->drush('drupal-directory', array('empty_theme'), $options);
  $output = $this->getOutput();
  $this->assertEquals(realpath($root . $sitewide . '/themes/empty_theme'), $output);
}