From a18ca98f9a41dc1d36a8e651c0365d699a7b98d5 Mon Sep 17 00:00:00 2001 From: Deltik Date: Thu, 15 Feb 2018 05:35:47 -0600 Subject: [PATCH] _beforeSuite() of modules called in \Helper\Base f080402675b6aebe4a73bba3ed1a82461d737239 only works when a Deployer is active, but local developers would not be using a Deployer. For some reason (still unknown), the Codeception framework doesn't execute _beforeSuite() for all the active modules, so \Helper\Base has been coded to pick up the slack. Actually fixes: #1 --- tests/_support/Helper/Base.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/_support/Helper/Base.php b/tests/_support/Helper/Base.php index 67693934a..be0b0d482 100644 --- a/tests/_support/Helper/Base.php +++ b/tests/_support/Helper/Base.php @@ -17,6 +17,11 @@ abstract class Base extends \Codeception\Module $this->deployer->start($this->deployer_components); $this->_callbackDeployerStarted(); } + foreach ($this->getModules() as $module) + { + if (get_class($module) !== get_class($this)) + $module->_beforeSuite(); + } } public function _afterSuite() @@ -39,7 +44,6 @@ abstract class Base extends \Codeception\Module $url = $this->deployer->getUrl(); $browser = $this->getModule('PhpBrowser'); $browser->_reconfigure(array('url' => $url)); - $browser->_beforeSuite(); } protected function _reconfigure_db() @@ -52,6 +56,5 @@ abstract class Base extends \Codeception\Module $db->_reconfigure($Db_config); // Next line is used to make connection available to any code after this point //$this->getModule('\Helper\DelayedDb')->_delayedInitialize(); - $db->_beforeSuite(); } }