From b261024111c97cf61e48e9e49ef16b1c521f2964 Mon Sep 17 00:00:00 2001 From: mark_story Date: Tue, 11 Oct 2011 22:10:09 -0400 Subject: [PATCH] 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 --- lib/Cake/TestSuite/Fixture/CakeFixtureManager.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php b/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php index 53f203144b5..cec4435003d 100644 --- a/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php +++ b/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)) {