X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fdrush%2Fdrush%2Ftests%2FCommandInfoAlterTest.php;fp=vendor%2Fdrush%2Fdrush%2Ftests%2FCommandInfoAlterTest.php;h=afd4b2e9c87d8de4b2d23d0786475ecc5a0aa295;hp=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/drush/drush/tests/CommandInfoAlterTest.php b/vendor/drush/drush/tests/CommandInfoAlterTest.php new file mode 100644 index 000000000..afd4b2e9c --- /dev/null +++ b/vendor/drush/drush/tests/CommandInfoAlterTest.php @@ -0,0 +1,36 @@ +setUpDrupal(1, true); + $this->setupModulesForTests(['woot'], Path::join(__DIR__, 'resources/modules/d8')); + $this->drush('pm-enable', ['woot']); + $this->drush('woot:altered', [], ['help' => true, 'debug' => true]); + $this->assertNotContains('woot-initial-alias', $this->getOutput()); + $this->assertContains('woot-new-alias', $this->getOutput()); + + // Check the debug messages. + $this->assertContains('[debug] Commands are potentially altered in Drupal\woot\WootCommandInfoAlterer.', $this->getErrorOutput()); + $this->assertContains("[debug] Module 'woot' changed the alias of 'woot:altered' command into 'woot-new-alias' in Drupal\woot\WootCommandInfoAlterer::alterCommandInfo().", $this->getErrorOutput()); + + // Try to run the command with the initial alias. + $this->drush('woot-initial-alias', [], [], null, null, self::EXIT_ERROR); + // Run the command with the altered alias. + $this->drush('woot-new-alias'); + } +}