Browse Source

Add a clear of the TableRegistry to tearDown

Adding a `TableRegistry::clear()` to the tearDown means that any instances of table classes loaded by tests are reset between test cases.

Without this it's possible to persist changes to the table class between test cases.

Relates to https://github.com/cakephp/bake/pull/275
David Yell 9 years ago
parent
commit
61d5902d77
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/TestSuite/TestCase.php

+ 1 - 0
src/TestSuite/TestCase.php

@@ -120,6 +120,7 @@ abstract class TestCase extends PHPUnit_Framework_TestCase
             Configure::clear();
             Configure::write($this->_configure);
         }
+        TableRegistry::clear();
     }
 
     /**