Browse files

Reversing the order fixtures are truncated in order to remove

data in a way that better supports foreign keys.
Fixes #1837
  • Loading branch information...
1 parent ff5ac73 commit 3cf4dd8b6c32d359965f2a7428f478d7facad0c0 @markstory markstory committed Jul 20, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 cake/tests/lib/cake_test_case.php
View
4 cake/tests/lib/cake_test_case.php
@@ -488,7 +488,7 @@ function after($method) {
$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 @@ function __array_permute($items, $perms = array()) {
return $permuted;
}
}
-}
+}

0 comments on commit 3cf4dd8

Please sign in to comment.