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
This commit is contained in:
mark_story 2008-10-15 16:50:10 +00:00
parent 19975a2cf6
commit cdc12d9eb8

View file

@ -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;