From 2f7dc7a7a8c79333171c20b132a6632007fda99e Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Mon, 19 Mar 2018 10:03:32 +1300 Subject: [PATCH] Clear hints cache for SS 4.1 only if method exists (SS 4.0 support) --- tests/php/SiteTreeSubsitesTest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/php/SiteTreeSubsitesTest.php b/tests/php/SiteTreeSubsitesTest.php index 61521a59..f14e7789 100644 --- a/tests/php/SiteTreeSubsitesTest.php +++ b/tests/php/SiteTreeSubsitesTest.php @@ -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);