From 33e737f233b2fac3ba49e61e117ba6b6d0766838 Mon Sep 17 00:00:00 2001 From: Rajeshreeputra Date: Wed, 2 Feb 2022 13:25:21 +0530 Subject: [PATCH 1/9] drush-4588: PM enable to install change --- docs/usage.md | 5 ++--- src/Drupal/Commands/pm/PmCommands.php | 8 ++++---- src/Preflight/Preflight.php | 2 +- tests/functional/COVERAGE.txt | 4 ++-- tests/functional/ConfigTest.php | 2 +- tests/functional/LocaleTest.php | 2 +- tests/functional/UpdateDBTest.php | 8 ++++---- tests/integration/MigrateRunnerTest.php | 2 +- tests/integration/ModuleGeneratorTest.php | 2 +- tests/unit/ArgsRemapperTest.php | 6 +++--- 10 files changed, 20 insertions(+), 21 deletions(-) diff --git a/docs/usage.md b/docs/usage.md index 9a0e049819..7b8047beef 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -15,8 +15,8 @@ Using the --uri option and --root options. For multi-site installations, use a site alias or the --uri option to target a particular site. - $ drush --uri=http://example.com pm:enable - + $ drush --uri=http://example.com pm:install + If you are outside the Composer project and not using a site alias, you need to specify --root and --uri for Drush to locate and bootstrap the right Drupal site. Site Aliases @@ -34,4 +34,3 @@ $ drush sql:sync --structure-tables-key=custom @live @self ``` See [Site aliases](site-aliases.md) for more information. - diff --git a/src/Drupal/Commands/pm/PmCommands.php b/src/Drupal/Commands/pm/PmCommands.php index 1e00ac2087..5c8f8dc717 100644 --- a/src/Drupal/Commands/pm/PmCommands.php +++ b/src/Drupal/Commands/pm/PmCommands.php @@ -65,12 +65,12 @@ public function getExtensionListModule(): ModuleExtensionList /** * Enable one or more modules. * - * @command pm:enable + * @command pm:install * @param $modules A comma delimited list of modules. - * @aliases en,pm-enable + * @aliases install, pm-install * @bootstrap root */ - public function enable(array $modules): void + public function install(array $modules): void { $modules = StringUtils::csvToArray($modules); $todo = $this->addInstallDependencies($modules); @@ -97,7 +97,7 @@ public function enable(array $modules): void /** * Run requirements checks on the module installation. * - * @hook validate pm:enable + * @hook validate pm:install * * @throws UserAbortException * @throws MissingDependencyException diff --git a/src/Preflight/Preflight.php b/src/Preflight/Preflight.php index 89475eb6f9..a7688f8a10 100644 --- a/src/Preflight/Preflight.php +++ b/src/Preflight/Preflight.php @@ -141,7 +141,7 @@ protected function remapCommandAliases(): array { return [ 'si' => 'site:install', - 'en' => 'pm:enable', + 'install' => 'pm:install', // php was an alias for core-cli which got renamed to php-cli. See https://github.com/drush-ops/drush/issues/3091. 'php' => 'php:cli', ]; diff --git a/tests/functional/COVERAGE.txt b/tests/functional/COVERAGE.txt index 1355f573e3..26d4e11891 100644 --- a/tests/functional/COVERAGE.txt +++ b/tests/functional/COVERAGE.txt @@ -1,6 +1,6 @@ COMMANDS ------------ -pm:enable: GOOD. testEnDisUnList(). +pm:install: GOOD. testEnDisUnList(). pm:uninstall: GOOD. testEnDisUnList(). pm:list: GOOD. testEnDisUnList(). pm:security: GOOD. @@ -38,4 +38,4 @@ state: NONE ssh: GOOD topic watchdog:*: GOOD -user:*: GOOD. \ No newline at end of file +user:*: GOOD. diff --git a/tests/functional/ConfigTest.php b/tests/functional/ConfigTest.php index f10c3d9f7d..5b459d5951 100644 --- a/tests/functional/ConfigTest.php +++ b/tests/functional/ConfigTest.php @@ -21,7 +21,7 @@ public function setup(): void $this->setUpDrupal(1, true); // Field module is needed for now for --existing-config. It is not actually // enabled after testing profile is installed. Its required by file and update though. - $this->drush('pm:enable', ['config, field']); + $this->drush('pm:install', ['config, field']); } } diff --git a/tests/functional/LocaleTest.php b/tests/functional/LocaleTest.php index d1b9066ea5..e497ec31c7 100644 --- a/tests/functional/LocaleTest.php +++ b/tests/functional/LocaleTest.php @@ -22,7 +22,7 @@ public function setup(): void if (!$this->getSites()) { $this->setUpDrupal(1, true); } - $this->drush('pm:enable', ['language', 'locale']); + $this->drush('pm:install', ['language', 'locale']); $this->drush('language:add', ['nl'], ['skip-translations' => null]); $this->sourceFile = Path::join(__DIR__, '/resources/drush_empty_module.nl.po'); diff --git a/tests/functional/UpdateDBTest.php b/tests/functional/UpdateDBTest.php index 230702543f..2ffdc44686 100644 --- a/tests/functional/UpdateDBTest.php +++ b/tests/functional/UpdateDBTest.php @@ -17,7 +17,7 @@ class UpdateDBTest extends CommandUnishTestCase public function testUpdateDBStatus() { $this->setUpDrupal(1, true); - $this->drush('pm:enable', ['drush_empty_module']); + $this->drush('pm:install', ['drush_empty_module']); $this->drush('updatedb:status'); $err = $this->getErrorOutput(); $this->assertStringContainsString('[success] No database updates required.', $err); @@ -275,7 +275,7 @@ public function testBatchUpdateLogMessages() ]; $this->setUpDrupal(1, true); $this->setupModulesForTests(['woot'], Path::join(__DIR__, '/../fixtures/modules')); - $this->drush('pm:enable', ['woot'], $options); + $this->drush('pm:install', ['woot'], $options); // Force re-run of woot_update_8105(). $this->drush('php:eval', ['drupal_set_installed_schema_version("woot", 8104)'], $options); @@ -318,7 +318,7 @@ public function testEnableModuleViaUpdate() ]; $this->setUpDrupal(1, true); $this->setupModulesForTests(['woot'], Path::join(__DIR__, '/../fixtures/modules')); - $this->drush('pm:enable', ['woot'], $options); + $this->drush('pm:install', ['woot'], $options); // Force re-run of woot_update_8106(). $this->drush('php:eval', ['drupal_set_installed_schema_version("woot", 8105)'], $options); @@ -344,7 +344,7 @@ public function testEnableModuleViaPostUpdate() ]; $this->setUpDrupal(1, true); $this->setupModulesForTests(['woot'], Path::join(__DIR__, '/../fixtures/modules')); - $this->drush('pm:enable', ['woot'], $options); + $this->drush('pm:install', ['woot'], $options); // Force re-run of woot_post_update_install_taxonomy(). $this->forcePostUpdate('woot_post_update_install_taxonomy', $options); diff --git a/tests/integration/MigrateRunnerTest.php b/tests/integration/MigrateRunnerTest.php index bf16206804..67787a1df5 100644 --- a/tests/integration/MigrateRunnerTest.php +++ b/tests/integration/MigrateRunnerTest.php @@ -20,7 +20,7 @@ protected function setUp(): void { parent::setUp(); $this->setupModulesForTests(['woot'], Path::join(__DIR__, '/../fixtures/modules')); - $this->drush('pm:enable', ['migrate', 'node', 'woot']); + $this->drush('pm:install', ['migrate', 'node', 'woot']); } /** diff --git a/tests/integration/ModuleGeneratorTest.php b/tests/integration/ModuleGeneratorTest.php index 5efc8d9911..6f771fb743 100644 --- a/tests/integration/ModuleGeneratorTest.php +++ b/tests/integration/ModuleGeneratorTest.php @@ -17,7 +17,7 @@ class ModuleGeneratorTest extends UnishIntegrationTestCase public function testModuleGenerators(): void { $this->setupModulesForTests(['woot'], Path::join(__DIR__, '/../fixtures/modules')); - $this->drush('pm:enable', ['woot']); + $this->drush('pm:install', ['woot']); $this->drush('cc', ['drush']); $this->drush('generate', ['list']); $this->assertStringContainsString('woot:example', $this->getOutput()); diff --git a/tests/unit/ArgsRemapperTest.php b/tests/unit/ArgsRemapperTest.php index 3949be2a9f..110a9804af 100644 --- a/tests/unit/ArgsRemapperTest.php +++ b/tests/unit/ArgsRemapperTest.php @@ -20,7 +20,7 @@ public function testCommandAliases($argv, $expected) { $remapOptions = []; $remapCommandAliases = [ - 'en' => 'pm:enable' + 'install' => 'pm:install' ]; $sut = new ArgsRemapper($remapOptions, $remapCommandAliases); $result = $sut->remap($argv); @@ -35,8 +35,8 @@ public function argsProvider() { return [ [ - ['en', 'en'], - ['pm:enable', 'en'], + ['install', 'install'], + ['pm:install', 'install'], ], ]; } From 21554717cf1aeab14a396a19cd55ffca70dcd0e0 Mon Sep 17 00:00:00 2001 From: Rajeshreeputra Date: Wed, 2 Feb 2022 13:30:19 +0530 Subject: [PATCH 2/9] drush-4588: PM enable to install change with pm:enable alias in place --- src/Drupal/Commands/pm/PmCommands.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Drupal/Commands/pm/PmCommands.php b/src/Drupal/Commands/pm/PmCommands.php index 5c8f8dc717..6c389f7dd6 100644 --- a/src/Drupal/Commands/pm/PmCommands.php +++ b/src/Drupal/Commands/pm/PmCommands.php @@ -67,7 +67,7 @@ public function getExtensionListModule(): ModuleExtensionList * * @command pm:install * @param $modules A comma delimited list of modules. - * @aliases install, pm-install + * @aliases install, pm-install, en, pm-enable, pm:enable * @bootstrap root */ public function install(array $modules): void From 9b23632a84c270de27e13e0145a6cd34a6439007 Mon Sep 17 00:00:00 2001 From: Rajeshreeputra Date: Wed, 2 Feb 2022 13:35:00 +0530 Subject: [PATCH 3/9] drush-4588: PM enable to install change tests updated --- tests/functional/CommandInfoAlterTest.php | 2 +- tests/functional/ConfigTest.php | 2 +- tests/functional/ContainerTest.php | 2 +- tests/functional/DeployHookTest.php | 4 ++-- tests/functional/FieldTest.php | 2 +- tests/functional/LanguageAddTest.php | 6 +++--- tests/functional/MulitsiteContainerTest.php | 2 +- tests/functional/PmEnDisUnListInfoTest.php | 8 ++++---- tests/functional/PmEnLocaleImportTest.php | 4 ++-- tests/functional/QueueTest.php | 8 ++++---- tests/functional/RoleTest.php | 2 +- tests/functional/SqlSyncTest.php | 2 +- tests/functional/UpdateDBTest.php | 8 ++++---- tests/functional/UserTest.php | 2 +- tests/functional/WatchdogTailTest.php | 2 +- tests/integration/CoreTest.php | 2 +- tests/integration/ImageTest.php | 2 +- tests/integration/WatchdogTest.php | 2 +- 18 files changed, 31 insertions(+), 31 deletions(-) diff --git a/tests/functional/CommandInfoAlterTest.php b/tests/functional/CommandInfoAlterTest.php index d0a3b0d8c8..edd46976aa 100644 --- a/tests/functional/CommandInfoAlterTest.php +++ b/tests/functional/CommandInfoAlterTest.php @@ -19,7 +19,7 @@ public function testCommandInfoAlter() { $this->setUpDrupal(1, true); $this->setupModulesForTests(['woot'], Path::join(__DIR__, '/../fixtures/modules')); - $this->drush('pm-enable', ['woot']); + $this->drush('pm-install', ['woot']); $this->drush('woot:altered', [], ['help' => true, 'debug' => true]); $this->assertStringNotContainsString('woot-initial-alias', $this->getOutput()); $this->assertStringContainsString('woot-new-alias', $this->getOutput()); diff --git a/tests/functional/ConfigTest.php b/tests/functional/ConfigTest.php index 5b459d5951..61d3d92262 100644 --- a/tests/functional/ConfigTest.php +++ b/tests/functional/ConfigTest.php @@ -126,7 +126,7 @@ public function testConfigImport() 'include' => __DIR__, ]; $this->setupModulesForTests(['woot'], Path::join(__DIR__, '/../fixtures/modules')); - $this->drush('pm-enable', ['woot'], $options); + $this->drush('pm-install', ['woot'], $options); // Export the configuration. $this->drush('config:export'); diff --git a/tests/functional/ContainerTest.php b/tests/functional/ContainerTest.php index 9b034e23ce..3c612093ed 100644 --- a/tests/functional/ContainerTest.php +++ b/tests/functional/ContainerTest.php @@ -26,7 +26,7 @@ public function testContainer() $this->setupModulesForTests(['woot'], Path::join(__DIR__, '/../fixtures/modules')); // Enable our module. - $this->drush('pm-enable', ['woot']); + $this->drush('pm-install', ['woot']); // Set up for a config import with just one small piece. $this->drush('config-export'); diff --git a/tests/functional/DeployHookTest.php b/tests/functional/DeployHookTest.php index ac2efbe853..befa73b376 100644 --- a/tests/functional/DeployHookTest.php +++ b/tests/functional/DeployHookTest.php @@ -20,7 +20,7 @@ public function testDeployHooks() 'yes' => null, ]; $this->setupModulesForTests(['woot'], Path::join(__DIR__, '/../fixtures/modules')); - $this->drush('pm-enable', ['woot'], $options); + $this->drush('pm-install', ['woot'], $options); // Run deploy hooks. $this->drush('deploy:hook', [], $options, null, null, self::EXIT_ERROR); @@ -60,7 +60,7 @@ public function testSkipDeployHooks() { $this->setUpDrupal(1, true); $this->setupModulesForTests(['woot'], Path::join(__DIR__, '/../fixtures/modules')); - $this->drush('pm-enable', ['woot'], ['yes' => null]); + $this->drush('pm-install', ['woot'], ['yes' => null]); $options = [ 'format' => 'json' diff --git a/tests/functional/FieldTest.php b/tests/functional/FieldTest.php index 80bbc45df3..5294959479 100644 --- a/tests/functional/FieldTest.php +++ b/tests/functional/FieldTest.php @@ -17,7 +17,7 @@ public function setup(): void $this->setUpDrupal(1, true); // Create a content entity with bundles. CreateEntityType::createContentEntity($this); - $this->drush('pm-enable', ['text,field_ui,unish_article']); + $this->drush('pm-install', ['text,field_ui,unish_article']); $this->drush('php:script', ['create_unish_article_bundles'], ['script-path' => Path::join(__DIR__, 'resources')]); } } diff --git a/tests/functional/LanguageAddTest.php b/tests/functional/LanguageAddTest.php index 447ea670ba..77bf9b6980 100644 --- a/tests/functional/LanguageAddTest.php +++ b/tests/functional/LanguageAddTest.php @@ -17,7 +17,7 @@ protected function setup(): void parent::setUp(); if (empty($this->getSites())) { $this->setUpDrupal(1, true); - $this->drush('pm-enable', ['language']); + $this->drush('pm-install', ['language']); } } @@ -40,7 +40,7 @@ public function testLanguageAddWithTranslations() $this->markTestSkipped('Devel dev snapshot detected. Incompatible with translation import.'); } - $this->drush('pm-enable', ['language', 'locale', 'dblog']); + $this->drush('pm-install', ['language', 'locale', 'dblog']); $this->drush('config-set', ['locale.settings', 'translation.import_enabled', true]); // Setup the interface translation system and prepare a source translation file. @@ -54,7 +54,7 @@ public function testLanguageAddWithTranslations() $this->mkdir($translationDir); copy($source, Path::join($translationDir, 'drush_empty_module.nl.po')); - $this->drush('pm-enable', ['drush_empty_module']); + $this->drush('pm-install', ['drush_empty_module']); $this->drush('language-add', ['nl']); $this->drush('watchdog-show', []); diff --git a/tests/functional/MulitsiteContainerTest.php b/tests/functional/MulitsiteContainerTest.php index 55b90c9069..bf7bc8e61e 100644 --- a/tests/functional/MulitsiteContainerTest.php +++ b/tests/functional/MulitsiteContainerTest.php @@ -40,7 +40,7 @@ function my_module_cron() { $options['uri'] = 'dev'; file_put_contents($conf_dir . '/modules/my_module/my_module.info.yml', $info); file_put_contents($conf_dir . '/modules/my_module/my_module.module', $module); - $this->drush('pm-enable', ['my_module'], $options); + $this->drush('pm-install', ['my_module'], $options); $this->drush('cron', [], $options); $this->assertStringContainsString('Message: test', $this->getErrorOutput()); diff --git a/tests/functional/PmEnDisUnListInfoTest.php b/tests/functional/PmEnDisUnListInfoTest.php index 1c3adddb51..49f1850b5d 100644 --- a/tests/functional/PmEnDisUnListInfoTest.php +++ b/tests/functional/PmEnDisUnListInfoTest.php @@ -24,9 +24,9 @@ public function testEnDisUnList() $out = $this->getOutput(); $this->assertStringContainsString('drush_empty_module', $out); - // Test that pm-enable does not install a module if the install + // Test that pm-install does not install a module if the install // requirements are not met. - $this->drush('pm-enable', ['drush_empty_module'], [], null, null, self::EXIT_ERROR, null, [ + $this->drush('pm-install', ['drush_empty_module'], [], null, null, self::EXIT_ERROR, null, [ 'UNISH_FAIL_INSTALL_REQUIREMENTS' => 'drush_empty_module', ]); $err = $this->getErrorOutput(); @@ -37,8 +37,8 @@ public function testEnDisUnList() $out = $this->getOutput(); $this->assertStringContainsString('drush_empty_module', $out); - // Test pm-enable enables a module, and pm-list verifies that. - $this->drush('pm-enable', ['drush_empty_module']); + // Test pm-install enables a module, and pm-list verifies that. + $this->drush('pm-install', ['drush_empty_module']); $this->drush('pm-list', [], ['status' => 'enabled']); $out = $this->getOutput(); $this->assertStringContainsString('drush_empty_module', $out); diff --git a/tests/functional/PmEnLocaleImportTest.php b/tests/functional/PmEnLocaleImportTest.php index 64c9d38e53..5571aa037d 100644 --- a/tests/functional/PmEnLocaleImportTest.php +++ b/tests/functional/PmEnLocaleImportTest.php @@ -23,7 +23,7 @@ public function testBatchImportTranslations() $this->setUpDrupal(1, true); $root = $this->webroot(); - $this->drush('pm-enable', ['language', 'locale', 'dblog']); + $this->drush('pm-install', ['language', 'locale', 'dblog']); $this->drush('config-set', ['locale.settings', 'translation.import_enabled', true]); // Setup the interface translation system and prepare a source translation file. @@ -39,7 +39,7 @@ public function testBatchImportTranslations() $this->drush('language-add', ['nl']); - $this->drush('pm-enable', ['drush_empty_module']); + $this->drush('pm-install', ['drush_empty_module']); $this->drush('watchdog-show'); $this->assertStringContainsString('Translations imported:', $this->getSimplifiedOutput()); diff --git a/tests/functional/QueueTest.php b/tests/functional/QueueTest.php index 4a32aee3b2..99843aff5a 100644 --- a/tests/functional/QueueTest.php +++ b/tests/functional/QueueTest.php @@ -17,7 +17,7 @@ public function testQueue() $sites = $this->setUpDrupal(1, true); // Enable aggregator since it declares a queue. - $this->drush('pm-enable', ['aggregator']); + $this->drush('pm-install', ['aggregator']); $this->drush('queue-list'); $output = $this->getOutput(); @@ -46,7 +46,7 @@ public function testQueueDelete() $sites = $this->setUpDrupal(1, true); // Enable aggregator since it declares a queue. - $this->drush('pm-enable', ['aggregator']); + $this->drush('pm-install', ['aggregator']); // Add another item to the queue and make sure it was deleted. $this->drush('php-script', ['queue_script'], ['script-path' => __DIR__ . '/resources']); @@ -73,7 +73,7 @@ public function testRequeueException() // Enable woot module, which contains a queue worker that throws a // RequeueException. - $this->drush('pm-enable', ['woot'], [], null, null, self::EXIT_SUCCESS); + $this->drush('pm-install', ['woot'], [], null, null, self::EXIT_SUCCESS); // Add an item to the queue. $this->drush('php-script', ['requeue_script'], ['script-path' => __DIR__ . '/resources']); @@ -114,7 +114,7 @@ public function testCustomException() // Enable woot module, which contains a queue worker that throws a // custom exception. - $this->drush('pm-enable', ['woot'], [], null, null, self::EXIT_SUCCESS); + $this->drush('pm-install', ['woot'], [], null, null, self::EXIT_SUCCESS); // Add a couple of items to the queue. $this->drush('php-script', ['queue_custom_exception_script'], ['script-path' => __DIR__ . '/resources']); diff --git a/tests/functional/RoleTest.php b/tests/functional/RoleTest.php index 8103c573c0..f98978cc86 100644 --- a/tests/functional/RoleTest.php +++ b/tests/functional/RoleTest.php @@ -22,7 +22,7 @@ public function testRole() // In D8+, the testing profile has no perms. // Copy the module to where Drupal expects it. $this->setupModulesForTests(['user_form_test'], Path::join($this->webroot(), 'core/modules/user/tests/modules')); - $this->drush('pm-enable', ['user_form_test']); + $this->drush('pm-install', ['user_form_test']); $this->drush('role-list'); $output = $this->getOutput(); diff --git a/tests/functional/SqlSyncTest.php b/tests/functional/SqlSyncTest.php index 6a0ca77aee..2546b6dd13 100644 --- a/tests/functional/SqlSyncTest.php +++ b/tests/functional/SqlSyncTest.php @@ -95,7 +95,7 @@ public function localSqlSync() $mail = "joe.user@myhome.com"; // Add user fields and a test User. - $this->drush('pm-enable', ['field,text,telephone,comment'], $stage_options + ['yes' => null]); + $this->drush('pm-install', ['field,text,telephone,comment'], $stage_options + ['yes' => null]); $this->drush('php-script', ['user_fields-D8', $name, $mail], $stage_options + ['script-path' => __DIR__ . '/resources',]); // Copy stage to dev, and then sql:sanitize. diff --git a/tests/functional/UpdateDBTest.php b/tests/functional/UpdateDBTest.php index 2ffdc44686..1f83f427bf 100644 --- a/tests/functional/UpdateDBTest.php +++ b/tests/functional/UpdateDBTest.php @@ -64,7 +64,7 @@ public function testFailedUpdate($last_successful_update, $expected_status_repor 'yes' => null, ]; $this->setupModulesForTests(['woot'], Path::join(__DIR__, '/../fixtures/modules')); - $this->drush('pm-enable', ['woot'], $options); + $this->drush('pm-install', ['woot'], $options); // Force a pending update. $this->drush('php-script', ['updatedb_script'], ['script-path' => __DIR__ . '/resources']); @@ -148,7 +148,7 @@ public function testFailedPostUpdate() 'yes' => null, ]; $this->setupModulesForTests(['woot'], Path::join(__DIR__, '/../fixtures/modules')); - $this->drush('pm-enable', ['woot'], $options); + $this->drush('pm-install', ['woot'], $options); // Force re-run of woot_update_8104(). $this->drush('php:eval', array('drupal_set_installed_schema_version("woot", 8103)'), $options); @@ -198,7 +198,7 @@ public function testUpdateModuleWithServiceDependency() 'include' => __DIR__, ]; $this->setupModulesForTests(['woot'], Path::join(__DIR__, '/../fixtures/modules')); - $this->drush('pm-enable', ['woot'], $options); + $this->drush('pm-install', ['woot'], $options); // Force re-run of the post-update woot_post_update_install_drush_empty_module(). $this->forcePostUpdate('woot_post_update_install_drush_empty_module', $options); @@ -244,7 +244,7 @@ public function testSuccessfulUpdate() 'yes' => null, ]; $this->setupModulesForTests(['woot'], Path::join(__DIR__, '/../fixtures/modules')); - $this->drush('pm-enable', ['woot'], $options); + $this->drush('pm-install', ['woot'], $options); // Force re-run of woot_update_8104() which is expected to be completed successfully. $this->drush('php:eval', array('drupal_set_installed_schema_version("woot", 8103)'), $options); diff --git a/tests/functional/UserTest.php b/tests/functional/UserTest.php index 8007394211..630e4048f3 100644 --- a/tests/functional/UserTest.php +++ b/tests/functional/UserTest.php @@ -168,7 +168,7 @@ public function testUserLogin() public function testUserCancel() { CreateEntityType::createContentEntity($this); - $this->drush('pm-enable', ['text,unish_article']); + $this->drush('pm-install', ['text,unish_article']); $this->drush('php:script', ['create_unish_article_bundles'], ['script-path' => Path::join(__DIR__, 'resources')]); // Create one unish_article owned by our example user. $this->drush('php-script', ['create_unish_articles'], ['script-path' => Path::join(__DIR__, 'resources')]); diff --git a/tests/functional/WatchdogTailTest.php b/tests/functional/WatchdogTailTest.php index 520058c037..e846bd6e6f 100644 --- a/tests/functional/WatchdogTailTest.php +++ b/tests/functional/WatchdogTailTest.php @@ -17,7 +17,7 @@ class WatchdogTailTest extends CommandUnishTestCase public function testWatchdogTail() { $this->setUpDrupal(1, true); - $ret = $this->drush('pm-enable', ['dblog']); + $ret = $this->drush('pm-install', ['dblog']); $this->assertEquals($ret, 0); $options = []; $childDrushProcess = $this->drushBackground('watchdog-tail', [], $options + ['simulate' => null]); diff --git a/tests/integration/CoreTest.php b/tests/integration/CoreTest.php index 184cb81113..a051b59ad5 100644 --- a/tests/integration/CoreTest.php +++ b/tests/integration/CoreTest.php @@ -53,7 +53,7 @@ public function testDrupalDirectory() $output = $this->getOutput(); $this->assertEquals(Path::join($root, $sitewide . '/modules'), $output); - $this->drush('pm-enable', ['drush_empty_module']); + $this->drush('pm-install', ['drush_empty_module']); $this->drush('theme-enable', ['drush_empty_theme']); $this->drush('drupal-directory', ['drush_empty_module']); diff --git a/tests/integration/ImageTest.php b/tests/integration/ImageTest.php index 374ea1a2b0..9d2d2f1558 100644 --- a/tests/integration/ImageTest.php +++ b/tests/integration/ImageTest.php @@ -11,7 +11,7 @@ class ImageTest extends UnishIntegrationTestCase { public function testImage() { - $this->drush('pm-enable', ['image']); + $this->drush('pm-install', ['image']); $logo = 'core/themes/bartik/screenshot.png'; $styles_dir = $this->webroot() . '/sites/default/files/styles/'; $thumbnail = $styles_dir . 'thumbnail/public/' . $logo; diff --git a/tests/integration/WatchdogTest.php b/tests/integration/WatchdogTest.php index d6751d07ed..65228016b6 100644 --- a/tests/integration/WatchdogTest.php +++ b/tests/integration/WatchdogTest.php @@ -9,7 +9,7 @@ class WatchdogTest extends UnishIntegrationTestCase { public function testWatchdog() { - $this->drush('pm-enable', ['dblog']); + $this->drush('pm-install', ['dblog']); $this->drush('watchdog-delete', ['all'], ['yes' => true]); $output = $this->getErrorOutput(); $this->assertStringContainsString('All watchdog messages have been deleted', $output); From 6973128aa088a360a4672ccbd43f3652adf6eb50 Mon Sep 17 00:00:00 2001 From: Rajeshreeputra Date: Thu, 3 Feb 2022 13:17:56 +0530 Subject: [PATCH 4/9] added in as alias for pn:install --- src/Drupal/Commands/pm/PmCommands.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Drupal/Commands/pm/PmCommands.php b/src/Drupal/Commands/pm/PmCommands.php index 6c389f7dd6..88ee46d8a5 100644 --- a/src/Drupal/Commands/pm/PmCommands.php +++ b/src/Drupal/Commands/pm/PmCommands.php @@ -67,7 +67,7 @@ public function getExtensionListModule(): ModuleExtensionList * * @command pm:install * @param $modules A comma delimited list of modules. - * @aliases install, pm-install, en, pm-enable, pm:enable + * @aliases in, install, pm-install, en, pm-enable, pm:enable * @bootstrap root */ public function install(array $modules): void From bebfcd5edb05d518bbc4b7248b2b92d13a63cab2 Mon Sep 17 00:00:00 2001 From: Rajeshreeputra Date: Thu, 3 Feb 2022 13:20:00 +0530 Subject: [PATCH 5/9] added in alias for pm:install --- src/Preflight/Preflight.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Preflight/Preflight.php b/src/Preflight/Preflight.php index a7688f8a10..9e617fb7be 100644 --- a/src/Preflight/Preflight.php +++ b/src/Preflight/Preflight.php @@ -141,7 +141,7 @@ protected function remapCommandAliases(): array { return [ 'si' => 'site:install', - 'install' => 'pm:install', + 'in' => 'pm:install', // php was an alias for core-cli which got renamed to php-cli. See https://github.com/drush-ops/drush/issues/3091. 'php' => 'php:cli', ]; From 97025f61c515ffb96f1d284a7ca7100bfbb5f7d5 Mon Sep 17 00:00:00 2001 From: Rajeshreeputra Date: Thu, 3 Feb 2022 13:25:49 +0530 Subject: [PATCH 6/9] added all aliases of pm:install for testing --- tests/unit/ArgsRemapperTest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/unit/ArgsRemapperTest.php b/tests/unit/ArgsRemapperTest.php index 110a9804af..6c8f744f0d 100644 --- a/tests/unit/ArgsRemapperTest.php +++ b/tests/unit/ArgsRemapperTest.php @@ -35,8 +35,13 @@ public function argsProvider() { return [ [ + ['in', 'in'], ['install', 'install'], + ['pm-install', 'pm-install'], ['pm:install', 'install'], + ['en', 'en'], + ['pm-enable', 'pm-enable'], + ['pm:enable', 'en'], ], ]; } From 494e0373dd979cf441bda871498c64dfbf3098bb Mon Sep 17 00:00:00 2001 From: Rajeshreeputra Date: Thu, 3 Feb 2022 15:17:55 +0530 Subject: [PATCH 7/9] updated install to in --- tests/unit/ArgsRemapperTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/ArgsRemapperTest.php b/tests/unit/ArgsRemapperTest.php index 6c8f744f0d..8168c6a2aa 100644 --- a/tests/unit/ArgsRemapperTest.php +++ b/tests/unit/ArgsRemapperTest.php @@ -20,7 +20,7 @@ public function testCommandAliases($argv, $expected) { $remapOptions = []; $remapCommandAliases = [ - 'install' => 'pm:install' + 'in' => 'pm:install' ]; $sut = new ArgsRemapper($remapOptions, $remapCommandAliases); $result = $sut->remap($argv); From 029a0df92a271bf421c4e47a47dfb355d56e0044 Mon Sep 17 00:00:00 2001 From: Rajeshreeputra Date: Fri, 4 Feb 2022 09:09:26 +0530 Subject: [PATCH 8/9] added mapping for all aliases for pm:install --- src/Preflight/Preflight.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Preflight/Preflight.php b/src/Preflight/Preflight.php index 9e617fb7be..9c8ce42b00 100644 --- a/src/Preflight/Preflight.php +++ b/src/Preflight/Preflight.php @@ -142,6 +142,10 @@ protected function remapCommandAliases(): array return [ 'si' => 'site:install', 'in' => 'pm:install', + 'install' => 'pm:install', + 'pm-install' => 'pm:install', + 'en' => 'pm:install', + 'pm-enable' => 'pm:install', // php was an alias for core-cli which got renamed to php-cli. See https://github.com/drush-ops/drush/issues/3091. 'php' => 'php:cli', ]; From 9b3be9f96823eeea6a235c6a2e87055b69052f15 Mon Sep 17 00:00:00 2001 From: Moshe Weitzman Date: Fri, 15 Apr 2022 14:36:53 -0400 Subject: [PATCH 9/9] Undo test changes. Remove init command alias for core:init. It was blocking calls to 'in' --- src/Commands/LegacyCommands.php | 1 - tests/unit/ArgsRemapperTest.php | 9 ++------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/Commands/LegacyCommands.php b/src/Commands/LegacyCommands.php index df7086e896..91a883c10c 100644 --- a/src/Commands/LegacyCommands.php +++ b/src/Commands/LegacyCommands.php @@ -8,7 +8,6 @@ class LegacyCommands extends DrushCommands * The core:init command was removed. Please edit your .bashrc manually. * * @command core:init - * @aliases init * @hidden * @obsolete */ diff --git a/tests/unit/ArgsRemapperTest.php b/tests/unit/ArgsRemapperTest.php index 8168c6a2aa..8d035a5336 100644 --- a/tests/unit/ArgsRemapperTest.php +++ b/tests/unit/ArgsRemapperTest.php @@ -20,7 +20,7 @@ public function testCommandAliases($argv, $expected) { $remapOptions = []; $remapCommandAliases = [ - 'in' => 'pm:install' + 'en' => 'pm:enable' ]; $sut = new ArgsRemapper($remapOptions, $remapCommandAliases); $result = $sut->remap($argv); @@ -29,18 +29,13 @@ public function testCommandAliases($argv, $expected) } /** - * Provides arguments for ::ArgsRemapper + * Provides argumens for ::ArgsRemapper */ public function argsProvider() { return [ [ - ['in', 'in'], - ['install', 'install'], - ['pm-install', 'pm-install'], - ['pm:install', 'install'], ['en', 'en'], - ['pm-enable', 'pm-enable'], ['pm:enable', 'en'], ], ];