From 1496a4198a930e3f9412f6beb6c0307ddeeb6dda Mon Sep 17 00:00:00 2001 From: Patrick Webster Date: Tue, 8 May 2012 04:35:47 -0500 Subject: [ticket/10678] Add port handling for MSSQL tests PHPBB3-10678 --- tests/test_framework/phpbb_database_test_connection_manager.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/test_framework') diff --git a/tests/test_framework/phpbb_database_test_connection_manager.php b/tests/test_framework/phpbb_database_test_connection_manager.php index 0335c0de36..2e93b6799c 100644 --- a/tests/test_framework/phpbb_database_test_connection_manager.php +++ b/tests/test_framework/phpbb_database_test_connection_manager.php @@ -63,6 +63,13 @@ class phpbb_database_test_connection_manager // e.g. Driver={SQL Server Native Client 10.0};Server=(local)\SQLExpress; $dsn .= $this->config['dbhost']; + // Primarily for MSSQL Native/Azure as ODBC needs it in $dbhost, attached to the Server param + if ($this->config['dbport']) + { + $port_delimiter = (defined('PHP_OS') && substr(PHP_OS, 0, 3) === 'WIN') ? ',' : ':'; + $dsn .= $port_delimiter . $this->config['dbport']; + } + if ($use_db) { $dsn .= ';Database=' . $this->config['dbname']; -- cgit v1.2.1