mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge pull request #3646 from nanapi/no-truncate-fixture
Don't truncate test fixtures when the table has been freshly created.
This commit is contained in:
commit
c99c68684b
1 changed files with 6 additions and 2 deletions
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue