9 class SiteSetCommandCase extends CommandUnishTestCase
13 * Test functionality of site set.
15 public function testSiteSet()
17 if ($this->isWindows()) {
18 $this->markTestSkipped('Site-set not currently available on Windows.');
20 $sites = $this->setUpDrupal(2, true);
21 $site_aliases = $this->getAliases();
22 $this->assertCount(2, $site_aliases);
24 // Test changing aliases.
25 foreach ($site_aliases as $site_alias) {
26 $this->drush('site:set', [$site_alias]);
27 $output = $this->getErrorOutput();
28 $this->assertEquals('[success] Site set to ' . $site_alias, $output);
31 // Test setting the site to the special @none alias.
32 $this->drush('site:set', ['@none']);
33 $output = $this->getErrorOutput();
34 $this->assertEquals('[success] Site unset.', $output);
36 // Alternative to '@none'.
37 $this->drush('site:set', ['']);
38 $output = $this->getErrorOutput();
39 $this->assertEquals('[success] Site unset.', $output);
41 // @todo Fix this toggling.
42 $this->markTestSkipped('Inexplicably fails on TravisCI but not locally.');
44 // Toggle between the previous set alias and back again.
45 $this->drush('site:set', ['-']);
46 $output = $this->getErrorOutput();
47 $this->assertEquals('[success] Site set to ' . $site_aliases[0], $output);
48 $this->drush('site:set', ['-']);
49 $output = $this->getErrorOutput();
50 $this->assertEquals('[success] Site set to ' . $site_aliases[1], $output);