8000 [Form] Fix ChoiceType to ensure submitted data is not nested unnecessarily by issei-m · Pull Request #21267 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Form] Fix ChoiceType to ensure submitted data is not nested unnecessarily #21267

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 7 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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Move test data provider after the test method
  • Loading branch information
issei-m committed Feb 10, 2017
commit d6d2db52038efbf56ccd38d28728dfaf5021e7fd
Original file line number Diff line number Diff line change
Expand Up @@ -2285,16 +2285,6 @@ public function testCustomChoiceTypeDoesNotInheritChoiceLabels()
$this->assertNull($form->get('subChoice')->getConfig()->getOption('choice_label'));
}

public function invalidNestedValueTestMatrix()
{
return array(
'non-multiple, non-expanded' => array(false, false, array(array())),
'non-multiple, expanded' => array(false, true, array(array())),
'multiple, non-expanded' => array(true, false, array(array())),
'multiple, expanded' => array(true, true, array(array())),
);
}

/**
* @dataProvider invalidNestedValueTestMatrix
*/
Expand All @@ -2310,4 +2300,14 @@ public function testSubmitInvalidNestedValue($multiple, $expanded, $submissionDa
$this->assertFalse($form->isSynchronized());
$this->assertEquals('All choices submitted must be NULL or strings.', $form->getTransformationFailure()->getMessage());
}

public function invalidNestedValueTestMatrix()
{
return array(
'non-multiple, non-expanded' => array(false, false, array(array())),
'non-multiple, expanded' => array(false, true, array(array())),
'multiple, non-expanded' => array(true, false, array(array())),
'multiple, expanded' => array(true, true, array(array())),
);
}
}
0