mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
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
This commit is contained in:
parent
88197569ad
commit
f6934e3237
1 changed files with 1 additions and 7 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue