minor #35207 [Form] ensure to expect no validation for the right reasons (xabbuh)
This PR was merged into the 3.4 branch.
Discussion
----------
[Form] ensure to expect no validation for the right reasons
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Commits
-------
8d46f95f4c
ensure to expect no validation for the right reasons
This commit is contained in:
commit
9392f76519
@ -133,7 +133,10 @@ class FormValidatorTest extends ConstraintValidatorTestCase
|
|||||||
$parent->add($form);
|
$parent->add($form);
|
||||||
|
|
||||||
$form->setData($object);
|
$form->setData($object);
|
||||||
|
$parent->submit([]);
|
||||||
|
|
||||||
|
$this->assertTrue($form->isSubmitted());
|
||||||
|
$this->assertTrue($form->isSynchronized());
|
||||||
$this->expectNoValidate();
|
$this->expectNoValidate();
|
||||||
|
|
||||||
$this->validator->validate($form, new Form());
|
$this->validator->validate($form, new Form());
|
||||||
@ -188,10 +191,15 @@ class FormValidatorTest extends ConstraintValidatorTestCase
|
|||||||
'validation_groups' => [],
|
'validation_groups' => [],
|
||||||
])
|
])
|
||||||
->setData($object)
|
->setData($object)
|
||||||
|
->setCompound(true)
|
||||||
|
->setDataMapper(new PropertyPathMapper())
|
||||||
->getForm();
|
->getForm();
|
||||||
|
|
||||||
$form->setData($object);
|
$form->setData($object);
|
||||||
|
$form->submit([]);
|
||||||
|
|
||||||
|
$this->assertTrue($form->isSubmitted());
|
||||||
|
$this->assertTrue($form->isSynchronized());
|
||||||
$this->expectNoValidate();
|
$this->expectNoValidate();
|
||||||
|
|
||||||
$this->validator->validate($form, new Form());
|
$this->validator->validate($form, new Form());
|
||||||
@ -214,6 +222,8 @@ class FormValidatorTest extends ConstraintValidatorTestCase
|
|||||||
// Launch transformer
|
// Launch transformer
|
||||||
$form->submit('foo');
|
$form->submit('foo');
|
||||||
|
|
||||||
|
$this->assertTrue($form->isSubmitted());
|
||||||
|
$this->assertTrue($form->isSynchronized());
|
||||||
$this->expectNoValidate();
|
$this->expectNoValidate();
|
||||||
|
|
||||||
$this->validator->validate($form, new Form());
|
$this->validator->validate($form, new Form());
|
||||||
@ -236,6 +246,8 @@ class FormValidatorTest extends ConstraintValidatorTestCase
|
|||||||
$form->add($child);
|
$form->add($child);
|
||||||
$form->submit([]);
|
$form->submit([]);
|
||||||
|
|
||||||
|
$this->assertTrue($form->isSubmitted());
|
||||||
|
$this->assertTrue($form->isSynchronized());
|
||||||
$this->expectNoValidate();
|
$this->expectNoValidate();
|
||||||
|
|
||||||
$this->validator->validate($form, new Form());
|
$this->validator->validate($form, new Form());
|
||||||
@ -264,6 +276,8 @@ class FormValidatorTest extends ConstraintValidatorTestCase
|
|||||||
// Launch transformer
|
// Launch transformer
|
||||||
$form->submit('foo');
|
$form->submit('foo');
|
||||||
|
|
||||||
|
$this->assertTrue($form->isSubmitted());
|
||||||
|
$this->assertFalse($form->isSynchronized());
|
||||||
$this->expectNoValidate();
|
$this->expectNoValidate();
|
||||||
|
|
||||||
$this->validator->validate($form, new Form());
|
$this->validator->validate($form, new Form());
|
||||||
@ -299,6 +313,8 @@ class FormValidatorTest extends ConstraintValidatorTestCase
|
|||||||
// Launch transformer
|
// Launch transformer
|
||||||
$form->submit('foo');
|
$form->submit('foo');
|
||||||
|
|
||||||
|
$this->assertTrue($form->isSubmitted());
|
||||||
|
$this->assertFalse($form->isSynchronized());
|
||||||
$this->expectNoValidate();
|
$this->expectNoValidate();
|
||||||
|
|
||||||
$this->validator->validate($form, new Form());
|
$this->validator->validate($form, new Form());
|
||||||
@ -369,6 +385,8 @@ class FormValidatorTest extends ConstraintValidatorTestCase
|
|||||||
// Launch transformer
|
// Launch transformer
|
||||||
$form->submit(['child' => 'foo']);
|
$form->submit(['child' => 'foo']);
|
||||||
|
|
||||||
|
$this->assertTrue($form->isSubmitted());
|
||||||
|
$this->assertFalse($form->isSynchronized());
|
||||||
$this->expectNoValidate();
|
$this->expectNoValidate();
|
||||||
|
|
||||||
$this->validator->validate($form, new Form());
|
$this->validator->validate($form, new Form());
|
||||||
@ -574,7 +592,10 @@ class FormValidatorTest extends ConstraintValidatorTestCase
|
|||||||
$form = $this->getBuilder()
|
$form = $this->getBuilder()
|
||||||
->setData('scalar')
|
->setData('scalar')
|
||||||
->getForm();
|
->getForm();
|
||||||
|
$form->submit('foo');
|
||||||
|
|
||||||
|
$this->assertTrue($form->isSubmitted());
|
||||||
|
$this->assertTrue($form->isSynchronized());
|
||||||
$this->expectNoValidate();
|
$this->expectNoValidate();
|
||||||
|
|
||||||
$this->validator->validate($form, new Form());
|
$this->validator->validate($form, new Form());
|
||||||
@ -592,6 +613,8 @@ class FormValidatorTest extends ConstraintValidatorTestCase
|
|||||||
|
|
||||||
$form->submit(['foo' => 'bar']);
|
$form->submit(['foo' => 'bar']);
|
||||||
|
|
||||||
|
$this->assertTrue($form->isSubmitted());
|
||||||
|
$this->assertTrue($form->isSynchronized());
|
||||||
$this->expectNoValidate();
|
$this->expectNoValidate();
|
||||||
|
|
||||||
$this->validator->validate($form, new Form());
|
$this->validator->validate($form, new Form());
|
||||||
@ -613,6 +636,8 @@ class FormValidatorTest extends ConstraintValidatorTestCase
|
|||||||
|
|
||||||
$form->submit(['foo' => 'bar', 'baz' => 'qux', 'quux' => 'quuz']);
|
$form->submit(['foo' => 'bar', 'baz' => 'qux', 'quux' => 'quuz']);
|
||||||
|
|
||||||
|
$this->assertTrue($form->isSubmitted());
|
||||||
|
$this->assertTrue($form->isSynchronized());
|
||||||
$this->expectNoValidate();
|
$this->expectNoValidate();
|
||||||
|
|
||||||
$this->validator->validate($form, new Form());
|
$this->validator->validate($form, new Form());
|
||||||
|
Reference in New Issue
Block a user