mirror of
https://github.com/e107inc/e107.git
synced 2025-08-20 21:32:09 +02:00
Preparation for merge with e107 repository
Moved all test files to e107_tests subdirectory
This commit is contained in:
54
e107_tests/tests/_support/Helper/DelayedDb.php
Normal file
54
e107_tests/tests/_support/Helper/DelayedDb.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?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'];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user