-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
questionFurther information is requestedFurther information is requested
Description
I noticed that the following test's actual result is empty when the fieldset contains a checkbox.
The form works fine in real usage, both via Form::assemble() and in inline forms (as in example below).
public function testMethodApplyDefaultElementDecorators(): void
{
// A fieldset, a required checkbox, and a submit button should cover
// all default element decorators.
$form = new CompatForm();
$form->applyDefaultElementDecorators();
$fieldset = $form->createElement('fieldset', 'foo', [
'label' => 'Fieldset Label',
'description' => 'Fieldset Description',
'id' => 'foo-id'
]);
// Comment out the code below fixes the issue
// vvvvvvvvvvvvvvvvv
$fieldset->addElement('checkbox', 'fooAndBar', [
'label' => 'Fieldset Label',
'description' => 'Fieldset Description',
'id' => 'fooAndBar-id'
]);
$form->addElement($fieldset);
// ^^^^^^^^^^^^^^^^^^^
$form->addElement('submit', 'submit_form', ['label' => 'Submit Form']);
$expected = <<<'HTML'
<form class="icinga-form icinga-controls" method="POST">
SOMETHING
</form>
HTML;
$this->assertHtml($expected, $form);
}Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested