siteSetTest.php

  1. 8.0.x tests/siteSetTest.php
  2. 6.x tests/siteSetTest.php
  3. 7.x tests/siteSetTest.php
  4. 5.x tests/siteSetTest.php
  5. master tests/siteSetTest.php

Classes

Namesort descending Description
siteSetCommandCase @group base

File

tests/siteSetTest.php
View source
  1. <?php
  2. /**
  3. * @group base
  4. */
  5. class siteSetCommandCase extends Drush_CommandTestCase {
  6. function testSiteSet() {
  7. if ($this->is_windows()) {
  8. $this->markTestSkipped('Site-set not currently available on Windows.');
  9. }
  10. $sites = $this->setUpDrupal(1, TRUE);
  11. $site_names = array_keys($sites);
  12. $alias = '@' . $site_names[0];
  13. $this->drush('ev', array("drush_invoke('site-set', '$alias'); print drush_sitealias_site_get();"));
  14. $output = $this->getOutput();
  15. $this->assertEquals("Site set to $alias\n$alias", $output);
  16. $this->drush('site-set', array($alias));
  17. $expected = 'Site set to ' . $alias;
  18. $output = $this->getOutput();
  19. $this->assertEquals($expected, $output);
  20. $this->drush('site-set', array());
  21. $output = $this->getOutput();
  22. $this->assertEquals('Site set to @none', $output);
  23. $this->drush('ev', array("drush_invoke('site-set', '$alias'); print drush_sitealias_site_get();"));
  24. $output = $this->getOutput();
  25. $this->assertEquals("Site set to $alias
  26. $alias", $output);
  27. $this->drush('ev', array("drush_invoke('site-set', '$alias'); drush_invoke('site-set', '@none'); drush_invoke('site-set', '-'); print drush_sitealias_site_get();"));
  28. $output = $this->getOutput();
  29. $this->assertEquals("Site set to $alias
  30. Site set to @none
  31. Site set to $alias
  32. $alias", $output);
  33. }
  34. }