More updates to stop using dev or alpha or beta versions.
[yaffs-website] / vendor / drush / drush / tests / CommandInfoAlterTest.php
1 <?php
2
3 namespace Unish;
4
5 use Webmozart\PathUtil\Path;
6
7 /**
8  * @group commands
9  *
10  */
11 class CommandInfoAlterTest extends CommandUnishTestCase
12 {
13     use TestModuleHelperTrait;
14
15     /**
16      * Tests command info alter.
17      */
18     public function testCommandInfoAlter()
19     {
20         $this->setUpDrupal(1, true);
21         $this->setupModulesForTests(['woot'], Path::join(__DIR__, 'resources/modules/d8'));
22         $this->drush('pm-enable', ['woot']);
23         $this->drush('woot:altered', [], ['help' => true, 'debug' => true]);
24         $this->assertNotContains('woot-initial-alias', $this->getOutput());
25         $this->assertContains('woot-new-alias', $this->getOutput());
26
27         // Check the debug messages.
28         $this->assertContains('[debug] Commands are potentially altered in Drupal\woot\WootCommandInfoAlterer.', $this->getErrorOutput());
29         $this->assertContains("[debug] Module 'woot' changed the alias of 'woot:altered' command into 'woot-new-alias' in Drupal\woot\WootCommandInfoAlterer::alterCommandInfo().", $this->getErrorOutput());
30
31         // Try to run the command with the initial alias.
32         $this->drush('woot-initial-alias', [], [], null, null, self::EXIT_ERROR);
33         // Run the command with the altered alias.
34         $this->drush('woot-new-alias');
35     }
36 }