public function testSubmitInvalidNestedValue($multiple,
$expanded,
$submissionData) { $form =
$this->factory->
create(static::TESTED_TYPE, null,
[ 'choices' =>
$this->choices,
'multiple' =>
$multiple,
'expanded' =>
$expanded,
]);
$form->
submit($submissionData);
$this->
assertFalse($form->
isSynchronized());
$this->
assertInstanceOf(TransformationFailedException::
class,
$form->
getTransformationFailure());
if (!
$multiple && !
$expanded) { $this->
assertEquals('Submitted data was expected to be text or number, array given.',
$form->
getTransformationFailure()->
getMessage());
} else { $this->
assertEquals('All choices submitted must be NULL, strings or ints.',
$form->
getTransformationFailure()->
getMessage());
} } public static function invalidNestedValueTestMatrix() { return [ 'non-multiple, non-expanded' =>
[false, false,
[[]]],