Skip to content

Commit

Permalink
Merge pull request #11120 from creative-commoners/pulls/4.13/no-admin
Browse files Browse the repository at this point in the history
MNT Fix unit test when running without silverstripe/admin installed
  • Loading branch information
GuySartorelli authored Jan 31, 2024
2 parents 6fe377e + 0027637 commit f4c7631
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/php/Forms/ConfirmedPasswordFieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,9 @@ public function testChildFieldsAreRequired(bool $canBeEmpty, bool $required, boo
// 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');
Expand Down

0 comments on commit f4c7631

Please sign in to comment.