-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Labels
Description
Creating a connection to postgres database fails due to wrong parameter setup.
*** https://github.com/natterbox/Codeception-MultiDb/blame/master/src/Codeception/Extension/MultiDb.php
/**
* @see MultiDb::amConnectedToDb
*
* @param string $connector
*
* @throws ModuleException
* @return \Codeception\Lib\Driver\Db
*/
private function getDriver($connector)
{
if (!(isset($this->drivers[$connector]) && is_object($this->drivers[$connector]))) {
if (!isset($this->config['connectors'][$connector])) {
throw new ModuleException(
__CLASS__,
"The specified connector, {$connector}, does not exist in the configuration"
);
}
$config = $this->config['connectors'][$connector];
try {
$this->drivers[$connector] = Driver::create($config['dsn'], $config['user'], $config['password']);
$this->executeSqlAgainstDriver(
$this->drivers[$connector]->getDbh(),
"SET time_zone = '{$this->timezone}'"
);
} catch (\PDOException $e) {
throw new ModuleException(
__CLASS__,
$e->getMessage() . ' while creating PDO connection ['.get_class($e).']'
);
} catch (\Exception $e) {
throw new ModuleException(
__CLASS__,
$e->getMessage() . ' while creating PDO connection ['.get_class($e).']'
);
}
}
return $this->drivers[$connector];
}