mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge pull request #3838 from cakephp/revert-3646-no-truncate-fixture
Revert "No truncate when drop table." Not truncating tables when they are created causes a number of issues in ControllerTestCases as indicated by the comments in #3646 post merge.
This commit is contained in:
commit
2c53bc8a1b
1 changed files with 2 additions and 6 deletions
|
@ -229,9 +229,7 @@ class CakeFixtureManager {
|
|||
$db = ConnectionManager::getDataSource($fixture->useDbConfig);
|
||||
$db->begin();
|
||||
$this->_setupTable($fixture, $db, $test->dropTables);
|
||||
if (!$test->dropTables) {
|
||||
$fixture->truncate($db);
|
||||
}
|
||||
$fixture->truncate($db);
|
||||
$fixture->insert($db);
|
||||
$db->commit();
|
||||
}
|
||||
|
@ -276,9 +274,7 @@ class CakeFixtureManager {
|
|||
$db = ConnectionManager::getDataSource($fixture->useDbConfig);
|
||||
}
|
||||
$this->_setupTable($fixture, $db, $dropTables);
|
||||
if (!$dropTables) {
|
||||
$fixture->truncate($db);
|
||||
}
|
||||
$fixture->truncate($db);
|
||||
$fixture->insert($db);
|
||||
} else {
|
||||
throw new UnexpectedValueException(__d('cake_dev', 'Referenced fixture class %s not found', $name));
|
||||
|
|
Loading…
Reference in a new issue