diff --git a/cake/tests/cases/libs/cake_test_fixture.test.php b/cake/tests/cases/libs/cake_test_fixture.test.php index d28131d7b..d7b04cfc7 100644 --- a/cake/tests/cases/libs/cake_test_fixture.test.php +++ b/cake/tests/cases/libs/cake_test_fixture.test.php @@ -201,7 +201,7 @@ class CakeTestFixtureTest extends CakeTestCase { $Fixture =& new CakeTestFixtureDefaultImportFixture(); $Fixture->fields = $Fixture->records = null; - $Fixture->import = 'FixtureImportTestModel'; + $Fixture->import = array('model' => 'FixtureImportTestModel', 'connection' => 'new_test_suite'); $Fixture->init(); $this->assertEqual(array_keys($Fixture->fields), array('id', 'name', 'created')); diff --git a/cake/tests/lib/cake_test_fixture.php b/cake/tests/lib/cake_test_fixture.php index 46ae26404..acef3028c 100644 --- a/cake/tests/lib/cake_test_fixture.php +++ b/cake/tests/lib/cake_test_fixture.php @@ -67,11 +67,13 @@ class CakeTestFixture extends Object { $import = array_merge(array('connection' => 'default', 'records' => false), is_array($this->import) ? $this->import : array('model' => $this->import)); if (isset($import['model']) && App::import('Model', $import['model'])) { - $model =& ClassRegistry::init(array('class' => $import['model'], 'ds' => $import['connection'])); + ClassRegistry::config(array('ds' => $import['connection'])); + $model =& ClassRegistry::init($import['model']); $db =& ConnectionManager::getDataSource($model->useDbConfig); $db->cacheSources = false; $this->fields = $model->schema(true); $this->fields[$model->primaryKey]['key'] = 'primary'; + ClassRegistry::config(array('ds' => 'test_suite')); ClassRegistry::flush(); } elseif (isset($import['table'])) { $model =& new Model(null, $import['table'], $import['connection']); @@ -86,7 +88,6 @@ class CakeTestFixture extends Object { if (isset($import['records']) && $import['records'] !== false && isset($model) && isset($db)) { $this->records = array(); - $query = array( 'fields' => array_keys($this->fields), 'table' => $db->fullTableName($model->table),