siteAliasTest.php

  1. 6.x tests/siteAliasTest.php
  2. 5.x tests/siteAliasTest.php
  3. 4.x tests/siteAliasTest.php

Classes

Namesort descending Description
saCase

File

tests/siteAliasTest.php
View source
  1. <?php
  2. /*
  3. * @file
  4. * Tests for sitealias.inc
  5. *
  6. * @group base
  7. */
  8. class saCase extends Drush_CommandTestCase {
  9. /*
  10. * Assure that site lists work as expected.
  11. * @todo Use --backend for structured return data. Depends on http://drupal.org/node/1043922
  12. */
  13. public function testSAList() {
  14. $sites = $this->setUpDrupal(2);
  15. $subdirs = array_keys($sites);
  16. $eval = 'print "bon";';
  17. $options = array(
  18. 'yes' => NULL,
  19. 'root' => $this->webroot(),
  20. );
  21. foreach ($subdirs as $dir) {
  22. $dirs[] = "#$dir";
  23. }
  24. $this->drush('php-eval', array($eval), $options, implode(',', $dirs));
  25. $output = $this->getOutputAsList();
  26. // We sort the output, producing a screwy display, because we cannot
  27. // predict the order of the #dev >> and #stage >> lines, since they
  28. // are executed concurrently, and emitted in a non-deterministic order.
  29. sort($output);
  30. $expected = " #dev
  31. #stage
  32. #dev >> bon
  33. #stage >> bon
  34. Continue? (y/n): y
  35. You are about to execute 'php-eval print \"bon\";' non-interactively (--yes forced) on all of the following targets:";
  36. $this->assertEquals($expected, implode("\n", $output));
  37. }
  38. }