From f6934e3237185eebb0b12b19e0810726a8ee9fed Mon Sep 17 00:00:00 2001 From: nate Date: Tue, 1 Jul 2008 16:42:44 +0000 Subject: [PATCH] Fixing test database checking in CakeTestCase git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7303 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/tests/lib/cake_test_case.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/cake/tests/lib/cake_test_case.php b/cake/tests/lib/cake_test_case.php index 771936798..2d2f886ec 100644 --- a/cake/tests/lib/cake_test_case.php +++ b/cake/tests/lib/cake_test_case.php @@ -633,19 +633,13 @@ class CakeTestCase extends UnitTestCase { * @access protected */ function _initDb() { - $testDbAvailable = false; - - if (class_exists('DATABASE_CONFIG')) { - $dbConfig =& new DATABASE_CONFIG(); - $testDbAvailable = isset($dbConfig->test); - } + $testDbAvailable = in_array('test', array_keys(ConnectionManager::enumConnectionObjects())); if ($testDbAvailable) { // Try for test DB restore_error_handler(); @$db =& ConnectionManager::getDataSource('test'); set_error_handler('simpleTestErrorHandler'); - $testDbAvailable = $db->isConnected(); }