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

Namespace

Unish

Classes

Namesort descending Description
siteSetCommandCase @group base

File

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