From 5ad4838efb311ab0465d6beb4eb9eec2588e886b 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 --- .../modules/woot_deploy/woot_deploy.deploy.php | 17 +++++++++++++++++ .../modules/woot_deploy/woot_deploy.info.yml | 5 +++++ tests/functional/DeployHookTest.php | 18 ++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 tests/fixtures/modules/woot_deploy/woot_deploy.deploy.php create mode 100644 tests/fixtures/modules/woot_deploy/woot_deploy.info.yml diff --git a/tests/fixtures/modules/woot_deploy/woot_deploy.deploy.php b/tests/fixtures/modules/woot_deploy/woot_deploy.deploy.php new file mode 100644 index 0000000000..044bf3e1ac --- /dev/null +++ b/tests/fixtures/modules/woot_deploy/woot_deploy.deploy.php @@ -0,0 +1,17 @@ +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()); + } }