Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MNT Fix unit test #1321

Merged
merged 1 commit into from
Aug 27, 2024
Merged

Conversation

GuySartorelli
Copy link
Member

Fixes some unit tests. Comments will explain why the changes were needed.

Issue

$html = $userFormsOptionSetField->renderWith(UserFormsOptionSetField::class)->getValue();
$html = $userFormsOptionSetField->setTemplate(UserFormsOptionSetField::class)->Field()->getValue();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Options used in the template is actually an extra property that gets added in the Field() method.
Before this silently failed because it ended up looping over the "iterator" provided by ViewableData::getIterator() in an empty DBText.

Doesn't ultimately affect what the test is meant to test, so no need to backport this.

@emteknetnz emteknetnz merged commit 6eb29d3 into silverstripe:7 Aug 27, 2024
13 checks passed
@emteknetnz emteknetnz deleted the pulls/7/fix-tests branch August 27, 2024 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants