3f6f6c16188063e3d3cf060c0204a74484e7a8c9
[yaffs-website] / vendor / drush / drush / tests / SiteSetTest.php
1 <?php
2
3 namespace Unish;
4
5 /**
6  * @group base
7  * @group slow
8  */
9 class SiteSetCommandCase extends CommandUnishTestCase
10 {
11
12     /**
13      * Test functionality of site set.
14      */
15     public function testSiteSet()
16     {
17         if ($this->isWindows()) {
18             $this->markTestSkipped('Site-set not currently available on Windows.');
19         }
20         $sites = $this->setUpDrupal(2, true);
21         $site_aliases = $this->getAliases();
22         $this->assertCount(2, $site_aliases);
23
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);
29         }
30
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);
35
36         // Alternative to '@none'.
37         $this->drush('site:set', ['']);
38         $output = $this->getErrorOutput();
39         $this->assertEquals('[success] Site unset.', $output);
40
41         // @todo Fix this toggling.
42         $this->markTestSkipped('Inexplicably fails on TravisCI but not locally.');
43
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);
51     }
52 }