forward the label_html option to expanded choice fields
This commit is contained in:
parent
7866a0fbd6
commit
fbe49cf84d
@ -395,6 +395,7 @@ class ChoiceType extends AbstractType
|
||||
$choiceOpts = [
|
||||
'value' => $choiceView->value,
|
||||
'label' => $choiceView->label,
|
||||
'label_html' => $options['label_html'],
|
||||
'attr' => $choiceView->attr,
|
||||
'translation_domain' => $options['choice_translation_domain'],
|
||||
'block_name' => 'entry',
|
||||
|
@ -392,6 +392,20 @@ class ChoiceTypeTest extends BaseTypeTest
|
||||
}
|
||||
}
|
||||
|
||||
public function testExpandedCheckboxesInhertLabelHtmlOption()
|
||||
{
|
||||
$form = $this->factory->create(static::TESTED_TYPE, null, [
|
||||
'choices' => $this->choices,
|
||||
'expanded' => true,
|
||||
'label_html' => true,
|
||||
'multiple' => true,
|
||||
]);
|
||||
|
||||
foreach ($form as $child) {
|
||||
$this->assertTrue($child->getConfig()->getOption('label_html'));
|
||||
}
|
||||
}
|
||||
|
||||
public function testExpandedRadiosAreRequiredIfChoiceChildIsRequired()
|
||||
{
|
||||
$form = $this->factory->create(static::TESTED_TYPE, null, [
|
||||
@ -420,6 +434,20 @@ class ChoiceTypeTest extends BaseTypeTest
|
||||
}
|
||||
}
|
||||
|
||||
public function testExpandedRadiosInhertLabelHtmlOption()
|
||||
{
|
||||
$form = $this->factory->create(static::TESTED_TYPE, null, [
|
||||
'choices' => $this->choices,
|
||||
'expanded' => true,
|
||||
'label_html' => true,
|
||||
'multiple' => false,
|
||||
]);
|
||||
|
||||
foreach ($form as $child) {
|
||||
$this->assertTrue($child->getConfig()->getOption('label_html'));
|
||||
}
|
||||
}
|
||||
|
||||
public function testSubmitSingleNonExpanded()
|
||||
{
|
||||
$form = $this->factory->create(static::TESTED_TYPE, null, [
|
||||
|
Reference in New Issue
Block a user