Merge pull request #11120 from creative-commoners/pulls/4.13/no-admin

MNT Fix unit test when running without silverstripe/admin installed
This commit is contained in:
Guy Sartorelli 2024-02-01 09:03:38 +13:00 committed by GitHub
commit f4c7631719
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -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');