diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2008-09-27 07:08:44 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2008-09-27 07:08:44 +0000 |
commit | f19d83c4c2ccebbd8fbd6af246a07b0bedac72f6 (patch) | |
tree | 7da1dd31d1011c8abbc0a743a290b1bbca8fa337 | |
parent | 2cb811acb30f0d1efe395be2cd748e479fe873b6 (diff) | |
download | brdo-f19d83c4c2ccebbd8fbd6af246a07b0bedac72f6.tar.gz brdo-f19d83c4c2ccebbd8fbd6af246a07b0bedac72f6.tar.bz2 |
#302300 follow-up by Crell: Fixes to database connection tests.
-rw-r--r-- | includes/database/database.inc | 2 | ||||
-rw-r--r-- | modules/simpletest/tests/database_test.test | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/includes/database/database.inc b/includes/database/database.inc index 4c3bf1fb5..f237de62b 100644 --- a/includes/database/database.inc +++ b/includes/database/database.inc @@ -839,7 +839,7 @@ abstract class Database { final protected static function openConnection($key, $target) { global $db_prefix; - if (empty(self::$connectionInfo)) { + if (empty(self::$databaseInfo)) { self::parseConnectionInfo(); } try { diff --git a/modules/simpletest/tests/database_test.test b/modules/simpletest/tests/database_test.test index 124d18ef1..ec6e6a9e3 100644 --- a/modules/simpletest/tests/database_test.test +++ b/modules/simpletest/tests/database_test.test @@ -127,13 +127,15 @@ class DatabaseConnectionTestCase extends DatabaseTestCase { // Clone the master credentials to a slave connection. // Note this will result in two independent connection objects that happen // to point to the same place. - $connection_info = Database::getConnectionInfo(); - Database::addConnectionInfo('default', 'slave', $connection_info['default']['default']); + $connection_info = Database::getConnectionInfo('default'); + Database::addConnectionInfo('default', 'slave', $connection_info['default']); $db1 = Database::getConnection('default', 'default'); $db2 = Database::getConnection('default', 'slave'); - $this->assertFalse($db1 === $db2, t('Each target refers to a different connection.')); + $this->assertNotNull($db1, t('default connection is a real connection object.')); + $this->assertNotNull($db2, t('slave connection is a real connection object.')); + $this->assertNotIdentical($db1, $db2, t('Each target refers to a different connection.')); } /** @@ -152,7 +154,7 @@ class DatabaseConnectionTestCase extends DatabaseTestCase { $db1 = Database::getConnection('default', 'default'); $db2 = Database::getConnection('default', 'slave'); - $this->assertTrue($db1 === $db2, t('Both targets refer to the same connection.')); + $this->assertIdentical($db1, $db2, t('Both targets refer to the same connection.')); } } |