mirror of
https://github.com/e107inc/e107.git
synced 2025-10-14 14:34:51 +02:00
e107 is now ready for fully automated testing on all three test suites: * Acceptance * Functional * Unit New features: * cPanelDeployer adds a cPanel Remote MySQL access host * e107 database dump importer * Unit tests now load e107 Fixes: * Test prefixes now only use characters valid for MySQL/MariaDB without escaping * Refactored a bunch of things * All existing tests pass now Changes: * Deployers now provided by \Helper\DeployerFactory * Added Twig templating for generating e107_config.php for testing * cPanelDeployer now outputs to codecept_debug()
60 lines
1018 B
PHP
60 lines
1018 B
PHP
<?php
|
|
namespace Helper;
|
|
|
|
// here you can define custom actions
|
|
// all public methods declared in helper class will be available in $I
|
|
|
|
class DelayedDb extends \Codeception\Module\Db
|
|
{
|
|
protected $requiredFields = [];
|
|
|
|
public function _initialize()
|
|
{
|
|
// Noop
|
|
}
|
|
|
|
public function _delayedInitialize()
|
|
{
|
|
return parent::_initialize();
|
|
}
|
|
|
|
public function getConfig()
|
|
{
|
|
return $this->config;
|
|
}
|
|
|
|
public function getDbHostname()
|
|
{
|
|
$matches = [];
|
|
$matched = preg_match('~host=([^;]+)~s', $this->config['dsn'], $matches);
|
|
if (!$matched)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
return $matches[1];
|
|
}
|
|
|
|
public function getDbName()
|
|
{
|
|
$matches = [];
|
|
$matched = preg_match('~dbname=([^;]+)~s', $this->config['dsn'], $matches);
|
|
if (!$matched)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
return $matches[1];
|
|
}
|
|
|
|
public function getDbUsername()
|
|
{
|
|
return $this->config['user'];
|
|
}
|
|
|
|
public function getDbPassword()
|
|
{
|
|
return $this->config['password'];
|
|
}
|
|
}
|