class FormErrorIteratorTest extends TestCase
{ /**
* @dataProvider findByCodesProvider
*/
public function testFindByCodes($code,
$violationsCount) { $formBuilder =
new FormBuilder( 'form',
null,
new EventDispatcher(),
new FormFactory(new FormRegistry([],
new ResolvedFormTypeFactory())),
[] );
$form =
$formBuilder->
getForm();
$cause =
new ConstraintViolation('Error 1!', null,
[], null, '', null, null, 'code1'
);
$form->
addError(new FormError('Error 1!', null,
[], null,
$cause));
$cause =
new ConstraintViolation('Error 2!', null,
[], null, '', null, null, 'code1'
);
$form->
addError(new FormError('Error 2!', null,
[], null,
$cause));
$cause =
new ConstraintViolation('Error 3!', null,
[], null, '', null, null, 'code2'
);
$form->
addError(new FormError('Error 3!', null,
[], null,
$cause));