Skip to content

Commit d6b2e20

Browse files
Add tests
1 parent 84e4a0c commit d6b2e20

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/Symfony/Component/Form/Tests/Extension/Core/Type/ChoiceTypeTest.php

+18
Original file line numberDiff line numberDiff line change
@@ -1994,6 +1994,24 @@ public function testStripLeadingUnderscoresAndDigitsFromId()
19941994
$this->assertEquals('_09name', $view->vars['full_name']);
19951995
}
19961996

1997+
public function testSubFormTranslationDomain()
1998+
{
1999+
$form = $this->factory->create(static::TESTED_TYPE, null, [
2000+
'label' => 'label',
2001+
'translation_domain' => 'label_translation_domain',
2002+
'choices' => [
2003+
'choice1' => true,
2004+
'choice2' => false,
2005+
],
2006+
'choice_translation_domain' => 'choice_translation_domain',
2007+
'expanded' => true,
2008+
])->createView();
2009+
2010+
$this->assertCount(2, $form->children);
2011+
$this->assertSame('choice_translation_domain', $form->children[0]->vars['translation_domain']);
2012+
$this->assertSame('choice_translation_domain', $form->children[1]->vars['translation_domain']);
2013+
}
2014+
19972015
/**
19982016
* @dataProvider provideTrimCases
19992017
*/

0 commit comments

Comments
 (0)