diff --git a/cake/libs/class_registry.php b/cake/libs/class_registry.php index 00d0b6e83..b4134df40 100644 --- a/cake/libs/class_registry.php +++ b/cake/libs/class_registry.php @@ -182,5 +182,15 @@ class ClassRegistry { return $_this->__map[$key]; } } +/** + * Flushes all objects from the ClassREgistry. + * + * @access public + */ + function flush() { + $_this =& ClassRegistry::getInstance(); + $_this->__objects = array(); + $_this->__map = array(); + } } ?> \ No newline at end of file diff --git a/cake/tests/cases/libs/model/model.test.php b/cake/tests/cases/libs/model/model.test.php index cdb181dc1..6f388e3b9 100644 --- a/cake/tests/cases/libs/model/model.test.php +++ b/cake/tests/cases/libs/model/model.test.php @@ -488,7 +488,6 @@ class ModelTest extends CakeTestCase { ) ); $this->assertEqual($result, $expected); - unset($this->DeviceType); } @@ -2738,6 +2737,10 @@ class ModelTest extends CakeTestCase { $this->assertEqual($afterFindData, $noAfterFindData); } + + function endTest() { + ClassRegistry::flush(); + } } /** * Short description for class.