mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
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:
parent
ffde2a06dd
commit
89185ace25
2 changed files with 14 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue