Skip to content

Commit

Permalink
No truncate when drop table.
Browse files Browse the repository at this point in the history
  • Loading branch information
akiyan committed Jun 5, 2014
1 parent 9c65337 commit 6d2402f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/Cake/TestSuite/Fixture/CakeFixtureManager.php
Expand Up @@ -229,7 +229,9 @@ public function load(CakeTestCase $test) {
$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();
}
Expand Down Expand Up @@ -274,7 +276,9 @@ public function loadSingle($name, $db = null, $dropTables = true) {
$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));
Expand Down

0 comments on commit 6d2402f

Please sign in to comment.