aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/test_framework/phpbb_database_test_connection_manager.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/test_framework/phpbb_database_test_connection_manager.php b/tests/test_framework/phpbb_database_test_connection_manager.php
index 5d643e43e2..3b5bab749e 100644
--- a/tests/test_framework/phpbb_database_test_connection_manager.php
+++ b/tests/test_framework/phpbb_database_test_connection_manager.php
@@ -85,11 +85,18 @@ class phpbb_database_test_connection_manager
break;
default:
- $dsn .= 'host=' . $this->config['dbhost'];
-
- if ($this->config['dbport'])
+ if (!empty($this->config['dbport']) && !is_numeric($this->config['dbport']) && $this->dbms['PDO'] != 'pgsql')
+ {
+ $dsn .= 'unix_socket=' . $this->config['dbport'];
+ }
+ else
{
- $dsn .= ';port=' . $this->config['dbport'];
+ $dsn .= 'host=' . $this->config['dbhost'];
+
+ if ($this->config['dbport'])
+ {
+ $dsn .= ';port=' . $this->config['dbport'];
+ }
}
if ($use_db)