writeLocalE107Config(); } public function _afterSuite() { parent::_afterSuite(); $this->revokeLocalE107Config(); } protected function writeLocalE107Config() { $twig_loader = new \Twig_Loader_Array([ 'e107_config.php' => file_get_contents(codecept_data_dir()."/e107_config.php.sample") ]); $twig = new \Twig_Environment($twig_loader); $db = $this->getModule('\Helper\DelayedDb'); $e107_config = []; //$e107_config['mySQLserver'] = $db->getDbHostname(); $e107_config['mySQLserver'] = 'localhost'; $e107_config['mySQLuser'] = $db->getDbUsername(); $e107_config['mySQLpassword'] = $db->getDbPassword(); $e107_config['mySQLdefaultdb'] = $db->getDbName(); $e107_config['mySQLprefix'] = $this->e107_mySQLprefix; $e107_config_contents = $twig->render('e107_config.php', $e107_config); file_put_contents(self::APP_PATH_E107_CONFIG, $e107_config_contents); } protected function revokeLocalE107Config() { unlink(self::APP_PATH_E107_CONFIG); } }