$this->
assertSame($db1,
$db2, 'Both targets refer to the same connection.'
);
} /**
* Tests the closing of a database connection.
*/
public function testConnectionClosing() { // Open the default target so we have an object to compare.
$db1 = Database::
getConnection('default', 'default'
);
// Try to close the default connection, then open a new one.
Database::
closeConnection('default', 'default'
);
$db2 = Database::
getConnection('default', 'default'
);
// Opening a connection after closing it should yield an object different than the original.
$this->
assertNotSame($db1,
$db2, 'Opening the default connection after it is closed returns a new object.'
);
} /**
* Tests the connection options of the active database.
*/
public function testConnectionOptions() { $connection_info = Database::
getConnectionInfo('default'
);