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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/php/FormField/UserFormsOptionSetFieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function testCustomErrorMessageValidationAttributesHTML()
$radio->Required = true;
$radio->CustomErrorMessage = 'My custom error message with \'single\' and "double" quotes';
$userFormsOptionSetField = $radio->getFormField();
$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.

$attributesHTML = 'data-rule-required="true" data-msg-required="My custom error message with 'single' and "double" quotes"';
$this->assertTrue(strpos($html ?? '', $attributesHTML ?? '') > 0);
}
Expand Down
Loading