function commandSpecificCase::testCommandSpecific

8.0.x commandSpecificTest.php commandSpecificCase::testCommandSpecific()
6.x commandSpecificTest.php commandSpecificCase::testCommandSpecific()
7.x commandSpecificTest.php commandSpecificCase::testCommandSpecific()
5.x commandSpecificTest.php commandSpecificCase::testCommandSpecific()
master commandSpecificTest.php commandSpecificCase::testCommandSpecific()

File

tests/commandSpecificTest.php, line 44
Assure that context API behaves as designed. Mostly implicitly tested, but we do have some edges that need explicit testing. *

Class

commandSpecificCase

Code

function testCommandSpecific() {
  $options = array(
    'alias-path' => UNISH_SANDBOX,
    'simulate' => NULL,
    'include-vcs' => NULL,
  );
  $this->drush('core-rsync', array('/tmp', '@site1'), $options, NULL, NULL, self::EXIT_SUCCESS, '2>&1');
  $output = trim($this->getOutput());
  $this->assertContains('excluded_by_target', $output);
  $this->drush('core-rsync', array('@site1', '/tmp'), $options, NULL, NULL, self::EXIT_SUCCESS, '2>&1');
  $output = trim($this->getOutput());
  $this->assertContains('excluded_by_source', $output);
  $this->drush('core-rsync', array('@site1', '@site1'), $options, NULL, NULL, self::EXIT_SUCCESS, '2>&1');
  $output = trim($this->getOutput());
  $this->assertContains('excluded_by_target', $output);
  // Now do that all again with 'exclude-files'
  $options['exclude-files'] = NULL;
  $this->drush('core-rsync', array('/tmp', '@site1'), $options, NULL, NULL, self::EXIT_SUCCESS, '2>&1');
  $output = trim($this->getOutput());
  $this->assertContains('sites/default/files', $output);
  $this->assertContains('excluded_by_target', $output);
  $this->assertNotContains('include-vcs', $output);
  $this->assertNotContains('exclude-paths', $output);
  $this->assertNotContains('exclude-files-processed', $output);
  $this->drush('core-rsync', array('@site1', '/tmp'), $options, NULL, NULL, self::EXIT_SUCCESS, '2>&1');
  $output = trim($this->getOutput());
  $this->assertContains('sites/default/files', $output);
  // This one does not work. @see drush_sitealias_evaluate_path
  //    $this->assertContains('excluded_by_source', $output);
  $this->assertNotContains('include-vcs', $output);
  $this->assertNotContains('exclude-paths', $output);
  $this->assertNotContains('exclude-files-processed', $output);
  $this->drush('core-rsync', array('@site1', '@site1'), $options, NULL, NULL, self::EXIT_SUCCESS, '2>&1');
  $output = trim($this->getOutput());
  $this->assertContains('sites/default/files', $output);
  $this->assertContains('excluded_by_target', $output);
  $this->assertNotContains('include-vcs', $output);
  $this->assertNotContains('exclude-paths', $output);
  $this->assertNotContains('exclude-files-processed', $output);
}