From e83435b2b6d3f93bd8cc7fe3678b02718a45c458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Werner=20M=2E=20Krau=C3=9F?= Date: Wed, 13 Sep 2017 06:13:55 +0200 Subject: [PATCH] update test for handling subsite specific themes fixes #309 --- tests/php/SiteTreeSubsitesTest.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/php/SiteTreeSubsitesTest.php b/tests/php/SiteTreeSubsitesTest.php index 2a27e2bf..8a5ff392 100644 --- a/tests/php/SiteTreeSubsitesTest.php +++ b/tests/php/SiteTreeSubsitesTest.php @@ -392,11 +392,20 @@ public function testIfSubsiteThemeIsSetToThemeList() $controller = ModelAsController::controller_for($pageWithTheme); SiteTree::singleton()->extend('contentcontrollerInit', $controller); $subsiteTheme = $pageWithTheme->Subsite()->Theme; + + $allThemes = SSViewer::get_themes(); + $this->assertContains( $subsiteTheme, - SSViewer::get_themes(), + $allThemes, 'Themes should be modified when Subsite has theme defined' ); + + $this->assertEquals( + $subsiteTheme, + array_shift($allThemes), + 'Subsite theme should be prepeded to theme list' + ); } public function provideAlternateAbsoluteLink()