Version 1
[yaffs-website] / vendor / drush / drush / tests / siteSetTest.php
diff --git a/vendor/drush/drush/tests/siteSetTest.php b/vendor/drush/drush/tests/siteSetTest.php
new file mode 100644 (file)
index 0000000..46d29d3
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+
+namespace Unish;
+
+/**
+ * @group base
+ */
+class siteSetCommandCase extends CommandUnishTestCase {
+
+  function testSiteSet() {
+    if ($this->is_windows()) {
+      $this->markTestSkipped('Site-set not currently available on Windows.');
+    }
+    $sites = $this->setUpDrupal(1, TRUE);
+    $site_names = array_keys($sites);
+    $alias = '@' . $site_names[0];
+
+    $this->drush('ev', array("drush_invoke('site-set', '$alias'); print drush_sitealias_site_get();"));
+    $output = $this->getOutput();
+    $this->assertEquals("Site set to $alias\n$alias", $output);
+
+    $this->drush('site-set', array());
+    $output = $this->getOutput();
+    $this->assertEquals('Site set to @none', $output);
+
+    $this->drush('site-set', array($alias));
+    $expected = 'Site set to ' . $alias;
+    $output = $this->getOutput();
+    $this->assertEquals($expected, $output);
+
+    $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();"));
+    $output = $this->getOutput();
+    $this->assertEquals("Site set to @none
+Site set to $alias
+Site set to @none
+Site set to $alias
+$alias", $output);
+  }
+}