Skip to content

Commit

Permalink
Clear hints cache for SS 4.1 only if method exists (SS 4.0 support)
Browse files Browse the repository at this point in the history
  • Loading branch information
robbieaverill committed Mar 18, 2018
1 parent 30454dc commit 2f7dc7a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/php/SiteTreeSubsitesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,12 @@ public function testPageTypesBlacklistInCMSMain()
$this->assertNotContains(TestClassB::class, $classes);

Subsite::changeSubsite($s2);
$cmsmain->getHintsCache()->clear();
// SS 4.1 and above
if ($cmsmain->hasMethod('getHintsCache')) {
$cmsmain->getHintsCache()->clear();
}
$hints = Convert::json2array($cmsmain->SiteTreeHints());

$classes = $hints['Root']['disallowedChildren'];
$this->assertNotContains(ErrorPage::class, $classes);
$this->assertNotContains(TestClassA::class, $classes);
Expand Down

0 comments on commit 2f7dc7a

Please sign in to comment.