mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
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:
parent
19975a2cf6
commit
cdc12d9eb8
1 changed files with 2 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue