From 6d2402fbf649e1ff1e37513220f42b80658c711b Mon Sep 17 00:00:00 2001 From: akiyan Date: Thu, 5 Jun 2014 13:37:22 +0900 Subject: [PATCH] No truncate when drop table. --- lib/Cake/TestSuite/Fixture/CakeFixtureManager.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php b/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php index 86007d2f4..1315469c2 100644 --- a/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php +++ b/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php @@ -229,7 +229,9 @@ class CakeFixtureManager { $db = ConnectionManager::getDataSource($fixture->useDbConfig); $db->begin(); $this->_setupTable($fixture, $db, $test->dropTables); - $fixture->truncate($db); + if (!$test->dropTables) { + $fixture->truncate($db); + } $fixture->insert($db); $db->commit(); } @@ -274,7 +276,9 @@ class CakeFixtureManager { $db = ConnectionManager::getDataSource($fixture->useDbConfig); } $this->_setupTable($fixture, $db, $dropTables); - $fixture->truncate($db); + if (!$dropTables) { + $fixture->truncate($db); + } $fixture->insert($db); } else { throw new UnexpectedValueException(__d('cake_dev', 'Referenced fixture class %s not found', $name));