mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR Added SiteTree::reset() to unset any in-memory caches (see DataObject::reset()). Using reset() in SapphireTest to avoid caches persisting across multiple tests
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@85337 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
1193aed711
commit
fec369531c
@ -2175,6 +2175,10 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
return $this->ParentID == 0 ? 'root' : 'subpage';
|
||||
}
|
||||
|
||||
static function reset() {
|
||||
self::$cache_permissions = array();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -63,6 +63,7 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
||||
Translatable::reset();
|
||||
Versioned::reset();
|
||||
DataObject::reset();
|
||||
SiteTree::reset();
|
||||
Controller::curr()->setSession(new Session(array()));
|
||||
|
||||
$className = get_class($this);
|
||||
|
Loading…
x
Reference in New Issue
Block a user