Make fixtures disable source caching.

Disabling source caching when using fixtures fixes
issues with test suites.  Testsuites could previously have
test order errors caused by differences in cached and un-cached sources listings.
Fixes #1942
This commit is contained in:
mark_story 2011-10-11 22:10:09 -04:00
parent c4eb19ab91
commit b261024111

View file

@ -84,6 +84,7 @@ class CakeFixtureManager {
return;
}
$db = ConnectionManager::getDataSource('test');
$db->cacheSources = false;
$this->_db = $db;
ClassRegistry::config(array('ds' => 'test'));
$this->_initialized = true;
@ -141,7 +142,7 @@ class CakeFixtureManager {
}
/**
* Runs the drop and create commands on the fixtures if necessary
* Runs the drop and create commands on the fixtures if necessary.
*
* @param CakeTestFixture $fixture the fixture object to create
* @param DataSource $db the datasource instance to use
@ -156,10 +157,7 @@ class CakeFixtureManager {
return;
}
$cacheSources = $db->cacheSources;
$db->cacheSources = false;
$sources = $db->listSources();
$db->cacheSources = $cacheSources;
$table = $db->config['prefix'] . $fixture->table;
if ($drop && in_array($table, $sources)) {