mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 21:27:25 +02:00
_beforeSuite() of modules called in \Helper\Base
f080402675
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
This commit is contained in:
@@ -17,6 +17,11 @@ abstract class Base extends \Codeception\Module
|
|||||||
$this->deployer->start($this->deployer_components);
|
$this->deployer->start($this->deployer_components);
|
||||||
$this->_callbackDeployerStarted();
|
$this->_callbackDeployerStarted();
|
||||||
}
|
}
|
||||||
|
foreach ($this->getModules() as $module)
|
||||||
|
{
|
||||||
|
if (get_class($module) !== get_class($this))
|
||||||
|
$module->_beforeSuite();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function _afterSuite()
|
public function _afterSuite()
|
||||||
@@ -39,7 +44,6 @@ abstract class Base extends \Codeception\Module
|
|||||||
$url = $this->deployer->getUrl();
|
$url = $this->deployer->getUrl();
|
||||||
$browser = $this->getModule('PhpBrowser');
|
$browser = $this->getModule('PhpBrowser');
|
||||||
$browser->_reconfigure(array('url' => $url));
|
$browser->_reconfigure(array('url' => $url));
|
||||||
$browser->_beforeSuite();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function _reconfigure_db()
|
protected function _reconfigure_db()
|
||||||
@@ -52,6 +56,5 @@ abstract class Base extends \Codeception\Module
|
|||||||
$db->_reconfigure($Db_config);
|
$db->_reconfigure($Db_config);
|
||||||
// Next line is used to make connection available to any code after this point
|
// Next line is used to make connection available to any code after this point
|
||||||
//$this->getModule('\Helper\DelayedDb')->_delayedInitialize();
|
//$this->getModule('\Helper\DelayedDb')->_delayedInitialize();
|
||||||
$db->_beforeSuite();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user