mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
Clear hints cache for SS 4.1 only if method exists (SS 4.0 support)
This commit is contained in:
parent
30454dc04f
commit
2f7dc7a7a8
@ -267,8 +267,12 @@ class SiteTreeSubsitesTest extends BaseSubsiteTest
|
|||||||
$this->assertNotContains(TestClassB::class, $classes);
|
$this->assertNotContains(TestClassB::class, $classes);
|
||||||
|
|
||||||
Subsite::changeSubsite($s2);
|
Subsite::changeSubsite($s2);
|
||||||
$cmsmain->getHintsCache()->clear();
|
// SS 4.1 and above
|
||||||
|
if ($cmsmain->hasMethod('getHintsCache')) {
|
||||||
|
$cmsmain->getHintsCache()->clear();
|
||||||
|
}
|
||||||
$hints = Convert::json2array($cmsmain->SiteTreeHints());
|
$hints = Convert::json2array($cmsmain->SiteTreeHints());
|
||||||
|
|
||||||
$classes = $hints['Root']['disallowedChildren'];
|
$classes = $hints['Root']['disallowedChildren'];
|
||||||
$this->assertNotContains(ErrorPage::class, $classes);
|
$this->assertNotContains(ErrorPage::class, $classes);
|
||||||
$this->assertNotContains(TestClassA::class, $classes);
|
$this->assertNotContains(TestClassA::class, $classes);
|
||||||
|
Loading…
Reference in New Issue
Block a user