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