Skip to content

Commit 65a765f

Browse files
committed
Add a test showing that choice type fails when submitting ints
1 parent a0945fc commit 65a765f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1689,6 +1689,18 @@ public function testSubmitMultipleExpandedNumericChoices()
16891689
$this->assertNull($form[4]->getViewData());
16901690
}
16911691

1692+
public function testSubmitMultipleChoicesInts()
1693+
{
1694+
$form = $this->factory->create(static::TESTED_TYPE, null, array(
1695+
'multiple' => true,
1696+
'choices' => $this->numericChoicesFlipped,
1697+
));
1698+
1699+
$form->submit(array(1, 2));
1700+
1701+
$this->assertTrue($form->isSynchronized());
1702+
}
1703+
16921704
public function testSingleSelectedObjectChoices()
16931705
{
16941706
$view = $this->factory->create(static::TESTED_TYPE, $this->objectChoices[3], array(

0 commit comments

Comments
 (0)