function coreCase::testPercentFilesOptimization

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

Test to see if the optimized code path in drush_sitealias_resolve_path_references that avoids a call to backend invoke when evaluating %files works.

File

tests/coreTest.php, line 45

Namespace

Unish

Class

coreCase
Tests for core commands.

Code

function testPercentFilesOptimization() {
  $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,
    'strict' => 0, // invoke from script: do not verify options
  );
  $php = '$a=drush_sitealias_get_record("@' . $site . '"); drush_sitealias_resolve_path_references($a, "%files"); print_r($a["path-aliases"]["%files"]);';
  $this->drush('ev', array($php), $options);
  $output = $this->getOutput();
  $expected = "sites/dev/files";
  $this->assertEquals($expected, $output);
}