Skip to content
Permalink
Browse files

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
  • Loading branch information...
markstory committed Oct 12, 2011
1 parent c4eb19a commit b261024111c97cf61e48e9e49ef16b1c521f2964
Showing with 2 additions and 4 deletions.
  1. +2 −4 lib/Cake/TestSuite/Fixture/CakeFixtureManager.php
@@ -84,6 +84,7 @@ protected function _initDb() {
return;
}
$db = ConnectionManager::getDataSource('test');
$db->cacheSources = false;
$this->_db = $db;
ClassRegistry::config(array('ds' => 'test'));
$this->_initialized = true;
@@ -141,7 +142,7 @@ protected function _loadFixtures($fixtures) {
}
/**
* 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 @@ protected function _setupTable($fixture, $db = null, $drop = true) {
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)) {

0 comments on commit b261024

Please sign in to comment.
You can’t perform that action at this time.