Permalink
Browse files

Always reconfigure global state.

Fixes issues wher the test suite with no fixtures could hit
a non test connection.

Fixes #2743
  • Loading branch information...
1 parent 863094d commit 790d9beeb743db45d3c193a0863228ab8d92b907 @markstory markstory committed Apr 5, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/Cake/TestSuite/Fixture/CakeFixtureManager.php
@@ -62,6 +62,9 @@ class CakeFixtureManager {
* @return void
*/
public function fixturize($test) {
+ if (!$this->_initialized) {
+ ClassRegistry::config(array('ds' => 'test', 'testing' => true));
+ }
if (empty($test->fixtures) || !empty($this->_processed[get_class($test)])) {
$test->db = $this->_db;
return;
@@ -90,7 +93,6 @@ protected function _initDb() {
$db = ConnectionManager::getDataSource('test');
$db->cacheSources = false;
$this->_db = $db;
- ClassRegistry::config(array('ds' => 'test', 'testing' => true));
$this->_initialized = true;
}

0 comments on commit 790d9be

Please sign in to comment.