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:
mark_story 2011-07-19 20:25:30 -04:00
parent ff5ac73988
commit 3cf4dd8b6c

View file

@ -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;
}
}
}
}