Fix sqlite issue on PHP 5.4 both for native and PDO driver
diff --git a/tests/mocks/database/db.php b/tests/mocks/database/db.php
index c30e6d2..59028ed 100644
--- a/tests/mocks/database/db.php
+++ b/tests/mocks/database/db.php
@@ -45,23 +45,16 @@
);
$config = array_merge($this->config[$group], $params);
+ $dsnstring = ( ! empty($config['dsn'])) ? $config['dsn'] : FALSE;
$pdodriver = ( ! empty($config['pdodriver'])) ? $config['pdodriver'] : FALSE;
$failover = ( ! empty($config['failover'])) ? $config['failover'] : FALSE;
- if ( ! empty($config['dsn']))
- {
- $dsn = $config['dsn'];
- }
- else
- {
- $dsn = $config['dbdriver'].'://'.$config['username'].':'.$config['password']
+ $dsn = $config['dbdriver'].'://'.$config['username'].':'.$config['password']
.'@'.$config['hostname'].'/'.$config['database'];
- }
-
// Build the parameter
$other_params = array_slice($config, 6);
- $other_params['dsn'] = $dsn;
+ if ($dsnstring) $other_params['dsn'] = $dsnstring;
if ($pdodriver) $other_params['pdodriver'] = $pdodriver;
if ($failover) $other_params['failover'] = $failover;