mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/17176] Do not always create a new connection in database tests
PHPBB3-17176
This commit is contained in:
parent
8a2199ed6c
commit
eed92e766f
2 changed files with 3 additions and 3 deletions
|
@ -431,8 +431,8 @@ class postgres extends \phpbb\db\driver\driver
|
|||
*/
|
||||
protected function _sql_close(): bool
|
||||
{
|
||||
// Released resources are already closed, return true in this case
|
||||
if (!$this->db_connect_id instanceof \PgSql\Connection)
|
||||
// Skip if connection is already closed or not persistent
|
||||
if (!$this->persistency || !$this->db_connect_id instanceof \PgSql\Connection)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -305,7 +305,7 @@ abstract class phpbb_database_test_case extends TestCase
|
|||
|
||||
/** @var \phpbb\db\driver\driver_interface $db */
|
||||
$db = new $config['dbms']();
|
||||
$db->sql_connect($config['dbhost'], $config['dbuser'], $config['dbpasswd'], $config['dbname'], $config['dbport'], false, true);
|
||||
$db->sql_connect($config['dbhost'], $config['dbuser'], $config['dbpasswd'], $config['dbname'], $config['dbport']);
|
||||
|
||||
$this->db_connections[] = $db;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue