From cdc12d9eb8edc274ae608eb2b5e23229b7af9933 Mon Sep 17 00:00:00 2001 From: mark_story Date: Wed, 15 Oct 2008 16:50:10 +0000 Subject: [PATCH] Changing cake_test_fixture::init() to not alter ClassRegistry::config() settings. Instead model is built with ds parameter. Closes #5578. git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7746 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/tests/lib/cake_test_fixture.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cake/tests/lib/cake_test_fixture.php b/cake/tests/lib/cake_test_fixture.php index b6a3f3fa8..861dde2fb 100644 --- a/cake/tests/lib/cake_test_fixture.php +++ b/cake/tests/lib/cake_test_fixture.php @@ -67,7 +67,7 @@ class CakeTestFixture extends Object { function init() { if (isset($this->import) && (is_string($this->import) || is_array($this->import))) { $import = array(); - + if (is_string($this->import) || is_array($this->import) && isset($this->import['model'])) { $import = array_merge(array('records' => false), is_array($this->import) ? $this->import : array()); $import['model'] = is_array($this->import) ? $this->import['model'] : $this->import; @@ -79,8 +79,7 @@ class CakeTestFixture extends Object { $connection = isset($import['connection']) ? $import['connection'] : 'default'; - ClassRegistry::config(array('ds' => $connection)); - $model =& ClassRegistry::init($import['model']); + $model =& ClassRegistry::init(array('class' => $import['model'], 'ds' => $connection)); $db =& ConnectionManager::getDataSource($model->useDbConfig); $db->cacheSources = false;