From 00276373b7738c073d14a86dc8f07b418cef465d Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Wed, 31 Jan 2024 15:02:44 +1300 Subject: [PATCH] MNT Fix unit test when running without silverstripe/admin installed --- tests/php/Forms/ConfirmedPasswordFieldTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/php/Forms/ConfirmedPasswordFieldTest.php b/tests/php/Forms/ConfirmedPasswordFieldTest.php index 42aa33c35..d49136e19 100644 --- a/tests/php/Forms/ConfirmedPasswordFieldTest.php +++ b/tests/php/Forms/ConfirmedPasswordFieldTest.php @@ -442,7 +442,9 @@ class ConfirmedPasswordFieldTest extends SapphireTest // CWP front-end templates break this logic - but there's no easy fix for that. // For the most part we are interested in ensuring this works in the CMS with default templates. $originalThemes = SSViewer::get_themes(); - SSViewer::set_themes(LeftAndMain::config()->uninherited('admin_themes')); + if (class_exists(LeftAndMain::class)) { + SSViewer::set_themes(LeftAndMain::config()->uninherited('admin_themes')); + } try { $form = new Form(); $field = new ConfirmedPasswordField('Test');