public function saCase::testSAList

8.0.x siteAliasTest.php public saCase::testSAList()
6.x siteAliasTest.php public saCase::testSAList()
7.x siteAliasTest.php public saCase::testSAList()
4.x siteAliasTest.php public saCase::testSAList()
5.x siteAliasTest.php public saCase::testSAList()
master siteAliasTest.php public saCase::testSAList()

Assure that site lists work as expected. @todo Use --backend for structured return data. Depends on http://drupal.org/node/1043922

File

tests/siteAliasTest.php, line 146

Namespace

Unish

Class

saCase
Tests for sitealias.inc

Code

public function testSAList() {
  $sites = $this->setUpDrupal(2);
  $subdirs = array_keys($sites);
  $eval = 'print "bon";';
  $options = array(
    'yes' => NULL,
    'verbose' => NULL,
    'root' => $this->webroot(),
  );
  foreach ($subdirs as $dir) {
    $dirs[] = "#$dir";
  }
  $this->drush('php-eval', array($eval), $options, implode(',', $dirs));
  $output = $this->getOutputAsList();
  $expected = "#stage >> bon
#dev   >> bon";
  $actual = implode("\n", $output);
  $actual = trim(preg_replace('/^#[a-z]* *>> *$/m', '', $actual)); // ignore blank lines
  $this->assertEquals($expected, $actual);
}