fixes #5259, undefined variable in CakeTestCase

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7462 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2008-08-13 16:24:21 +00:00
parent fe62d7f70d
commit 0b8d7027ec

View file

@ -156,7 +156,6 @@ class CakeTestCase extends UnitTestCase {
if (!isset($this->db)) {
$this->_initDb();
}
$classRegistry =& ClassRegistry::getInstance();
if ($controller->uses === false) {
$list = array($controller->modelClass);
@ -204,7 +203,7 @@ class CakeTestCase extends UnitTestCase {
}
foreach ($models as $model) {
$object =& $classRegistry->getObject($model['key']);
$object =& ClassRegistry::getObject($model['key']);
if ($object !== false) {
$object->setDataSource('test_suite');
$object->cacheSources = false;
@ -630,6 +629,8 @@ class CakeTestCase extends UnitTestCase {
function _initDb() {
$testDbAvailable = in_array('test', array_keys(ConnectionManager::enumConnectionObjects()));
$_prefix = null;
if ($testDbAvailable) {
// Try for test DB
restore_error_handler();