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