function coreCase::testRsyncPercentFiles

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

Test to see if rsync @site:%files calculates the %files path correctly. This tests the non-optimized code path in drush_sitealias_resolve_path_references.

File

tests/coreTest.php, line 22

Namespace

Unish

Class

coreCase
Tests for core commands.

Code

function testRsyncPercentFiles() {
  $root = $this->webroot();
  $site = key($this->getSites());
  $options = array(
    'root' => $root,
    'uri' => key($this->getSites()),
    'simulate' => NULL,
    'include-conf' => NULL,
    'include-vcs' => NULL,
    'yes' => NULL,
  );
  $this->drush('core-rsync', array("@$site:%files", "/tmp"), $options, NULL, NULL, self::EXIT_SUCCESS, '2>&1;');
  $output = $this->getOutput();
  $level = $this->log_level();
  $pattern = in_array($level, array('verbose', 'debug')) ? "Calling system(rsync -e 'ssh ' -akzv --stats --progress --yes %s /tmp);" : "Calling system(rsync -e 'ssh ' -akz --yes %s /tmp);";
  $expected = sprintf($pattern, UNISH_SANDBOX . "/web/sites/$site/files");
  $this->assertEquals($expected, $output);
}