Skip to content

Commit 05fac49

Browse files
Merge branch '3.4' into 4.3
* 3.4: Update links to documentation [Validator] Add the missing translations for the Arabic (ar) locale ensure to expect no validation for the right reasons [PhpUnitBridge] Add test case for @expectedDeprecation annotation Update year in license files [Console][FormatterHelper] Use helper strlen statically and remove duplicated code Fix BC issue in phpDoc Reflection library [Translator] Performance improvement in MessageCatalogue and catalogue operations.
2 parents bc319f1 + 99f6cf6 commit 05fac49

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2004-2019 Fabien Potencier
1+
Copyright (c) 2004-2020 Fabien Potencier
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The Form component allows you to easily create, process and reuse HTML forms.
66
Resources
77
---------
88

9-
* [Documentation](https://symfony.com/doc/current/components/form/index.html)
9+
* [Documentation](https://symfony.com/doc/current/components/form.html)
1010
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
1111
* [Report issues](https://github.com/symfony/symfony/issues) and
1212
[send Pull Requests](https://github.com/symfony/symfony/pulls)

Tests/Extension/Validator/Constraints/FormValidatorTest.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,10 @@ public function testDontValidateIfParentWithoutValidConstraint()
133133
$parent->add($form);
134134

135135
$form->setData($object);
136+
$parent->submit([]);
136137

138+
$this->assertTrue($form->isSubmitted());
139+
$this->assertTrue($form->isSynchronized());
137140
$this->expectNoValidate();
138141

139142
$this->validator->validate($form, new Form());
@@ -188,10 +191,15 @@ public function testDontValidateIfNoValidationGroups()
188191
'validation_groups' => [],
189192
])
190193
->setData($object)
194+
->setCompound(true)
195+
->setDataMapper(new PropertyPathMapper())
191196
->getForm();
192197

193198
$form->setData($object);
199+
$form->submit([]);
194200

201+
$this->assertTrue($form->isSubmitted());
202+
$this->assertTrue($form->isSynchronized());
195203
$this->expectNoValidate();
196204

197205
$this->validator->validate($form, new Form());
@@ -214,6 +222,8 @@ public function testDontValidateConstraintsIfNoValidationGroups()
214222
// Launch transformer
215223
$form->submit('foo');
216224

225+
$this->assertTrue($form->isSubmitted());
226+
$this->assertTrue($form->isSynchronized());
217227
$this->expectNoValidate();
218228

219229
$this->validator->validate($form, new Form());
@@ -236,6 +246,8 @@ public function testDontValidateChildConstraintsIfCallableNoValidationGroups()
236246
$form->add($child);
237247
$form->submit([]);
238248

249+
$this->assertTrue($form->isSubmitted());
250+
$this->assertTrue($form->isSynchronized());
239251
$this->expectNoValidate();
240252

241253
$this->validator->validate($form, new Form());
@@ -264,6 +276,8 @@ function () { throw new TransformationFailedException(); }
264276
// Launch transformer
265277
$form->submit('foo');
266278

279+
$this->assertTrue($form->isSubmitted());
280+
$this->assertFalse($form->isSynchronized());
267281
$this->expectNoValidate();
268282

269283
$this->validator->validate($form, new Form());
@@ -299,6 +313,8 @@ function () { throw new TransformationFailedException(); }
299313
// Launch transformer
300314
$form->submit('foo');
301315

316+
$this->assertTrue($form->isSubmitted());
317+
$this->assertFalse($form->isSynchronized());
302318
$this->expectNoValidate();
303319

304320
$this->validator->validate($form, new Form());
@@ -410,6 +426,8 @@ function () { throw new TransformationFailedException(); }
410426
// Launch transformer
411427
$form->submit(['child' => 'foo']);
412428

429+
$this->assertTrue($form->isSubmitted());
430+
$this->assertFalse($form->isSynchronized());
413431
$this->expectNoValidate();
414432

415433
$this->validator->validate($form, new Form());
@@ -615,7 +633,10 @@ public function testDontWalkScalars()
615633
$form = $this->getBuilder()
616634
->setData('scalar')
617635
->getForm();
636+
$form->submit('foo');
618637

638+
$this->assertTrue($form->isSubmitted());
639+
$this->assertTrue($form->isSynchronized());
619640
$this->expectNoValidate();
620641

621642
$this->validator->validate($form, new Form());
@@ -633,6 +654,8 @@ public function testViolationIfExtraData()
633654

634655
$form->submit(['foo' => 'bar']);
635656

657+
$this->assertTrue($form->isSubmitted());
658+
$this->assertTrue($form->isSynchronized());
636659
$this->expectNoValidate();
637660

638661
$this->validator->validate($form, new Form());
@@ -654,6 +677,8 @@ public function testViolationFormatIfMultipleExtraFields()
654677

655678
$form->submit(['foo' => 'bar', 'baz' => 'qux', 'quux' => 'quuz']);
656679

680+
$this->assertTrue($form->isSubmitted());
681+
$this->assertTrue($form->isSynchronized());
657682
$this->expectNoValidate();
658683

659684
$this->validator->validate($form, new Form());

0 commit comments

Comments
 (0)