mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
Reversing the order fixtures are truncated in order to remove
data in a way that better supports foreign keys. Fixes #1837
This commit is contained in:
parent
ff5ac73988
commit
3cf4dd8b6c
1 changed files with 2 additions and 2 deletions
|
@ -488,7 +488,7 @@ class CakeTestCase extends UnitTestCase {
|
|||
$isTestMethod = !in_array(strtolower($method), array('start', 'end'));
|
||||
|
||||
if (isset($this->_fixtures) && isset($this->db) && $isTestMethod) {
|
||||
foreach ($this->_fixtures as $fixture) {
|
||||
foreach (array_reverse($this->_fixtures) as $fixture) {
|
||||
$fixture->truncate($this->db);
|
||||
}
|
||||
$this->__truncated = true;
|
||||
|
@ -832,4 +832,4 @@ class CakeTestCase extends UnitTestCase {
|
|||
return $permuted;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue