8000 [Form] Choice type int values (BC Fix) by mcfedr · Pull Request #21957 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Form] Choice type int values (BC Fix) #21957

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

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
1010B Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add a test showing that choice type fails when submitting ints
  • Loading branch information
mcfedr committed Mar 10, 2017
commit 6d4290905650ad2304b251aeb5089d802686ee27
Original file line number Diff line number Diff line change
Expand Up @@ -1689,6 +1689,19 @@ public function testSubmitMultipleExpandedNumericChoices()
$this->assertNull($form[4]->getViewData());
}

public function testSubmitMultipleChoicesInts()
{
$form = $this->factory->create(static::TESTED_TYPE, null, array(
'multiple' => true,
'choices' => array_flip($this->numericChoicesFlipped),
'choices_as_values' => true,
));

$form->submit(array(1, 2));

$this->assertTrue($form->isSynchronized());
}

public function testSingleSelectedObjectChoices()
{
$view = $this->factory->create(static::TESTED_TYPE, $this->objectChoices[3], array(
Expand Down
0