From 556228e6ee1c66c1ee744b9bd89638d491ececd7 Mon Sep 17 00:00:00 2001 From: Pieter Frenssen Date: Tue, 30 Aug 2022 20:49:36 +0300 Subject: [PATCH] Test execution of deploy hooks inside a module with _deploy in the name. Test for #5216 --- tests/functional/DeployHookTest.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/functional/DeployHookTest.php b/tests/functional/DeployHookTest.php index befa73b376..6fab276f5d 100644 --- a/tests/functional/DeployHookTest.php +++ b/tests/functional/DeployHookTest.php @@ -94,4 +94,22 @@ public function testSkipDeployHooks() $this->drush('deploy:hook-status', [], $options, null, null, self::EXIT_SUCCESS); $this->assertStringContainsString('[]', $this->getOutput()); } + + public function testDeployHooksInModuleWithDeployInName() + { + $this->setUpDrupal(1, true); + $options = [ + 'yes' => null, + ]; + $this->setupModulesForTests(['woot_deploy'], Path::join(__DIR__, '/../fixtures/modules')); + $this->drush('pm-install', ['woot_deploy'], $options); + + // Run deploy hooks. + $this->drush('deploy:hook', [], $options, null, null, self::EXIT_SUCCESS); + + $this->assertStringContainsString('[notice] Deploy hook started: woot_deploy_deploy_function', $this->getErrorOutput()); + $this->assertStringContainsString('[notice] This is the update message from woot_deploy_deploy_function', $this->getErrorOutput()); + $this->assertStringContainsString('[notice] Performed: woot_deploy_deploy_function', $this->getErrorOutput()); + $this->assertStringContainsString('[success] Finished performing deploy hooks.', $this->getErrorOutput()); + } }