Adding ClassRegistry::flush() to reset the registry

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5868 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-10-22 20:58:55 +00:00
parent ffde2a06dd
commit 89185ace25
2 changed files with 14 additions and 1 deletions

View file

@ -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();
}
}
?>

View file

@ -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.