1
0
mirror of https://github.com/e107inc/e107.git synced 2025-10-09 03:56:24 +02:00
Files
php-e107/e107_tests/tests/_support/Helper/DelayedDb.php
Deltik e49ee50d31 Preparation for merge with e107 repository
Moved all test files to e107_tests subdirectory
2019-11-27 11:18:53 -06:00

55 lines
890 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 _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'];
}
}