Skip to content

Commit 098f870

Browse files
Merge branch '5.0'
* 5.0: (31 commits) [HttpClient] NativeHttpClient should not send >1.1 protocol version [HttpClient] fix support for non-blocking resource streams [Mailer] Make sure you can pass custom headers to Mailgun [Mailer] Remove line breaks in email attachment content Update links to documentation [Validator] Add the missing translations for the Arabic (ar) locale ensure to expect no validation for the right reasons [Security-Guard] fixed 35203 missing name tag in param docblock [HttpClient] fix casting responses to PHP streams [PhpUnitBridge] Add test case for @expectedDeprecation annotation [PhpUnitBridge][SymfonyTestsListenerTrait] Remove $testsWithWarnings stack [FrameworkBundle] Fix getUser() phpdoc in AbstractController [Mailer] Fix addresses management in Sendgrid API payload [Mailer][MailchimpBridge] Fix missing attachments when sending via Mandrill API [Mailer][MailchimpBridge] Fix incorrect sender address when sender has name [HttpClient] fix capturing SSL certificates with NativeHttpClient Update year in license files Update year in license files [TwigBridge][Form] Added missing help messages in form themes Update year in license files ...
2 parents 35cd1d6 + c96f80b commit 098f870

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
@@ -135,7 +135,10 @@ public function testDontValidateIfParentWithoutValidConstraint()
135135
$parent->add($form);
136136

137137
$form->setData($object);
138+
$parent->submit([]);
138139

140+
$this->assertTrue($form->isSubmitted());
141+
$this->assertTrue($form->isSynchronized());
139142
$this->expectNoValidate();
140143

141144
$this->validator->validate($form, new Form());
@@ -190,10 +193,15 @@ public function testDontValidateIfNoValidationGroups()
190193
'validation_groups' => [],
191194
])
192195
->setData($object)
196+
->setCompound(true)
197+
->setDataMapper(new PropertyPathMapper())
193198
->getForm();
194199

195200
$form->setData($object);
201+
$form->submit([]);
196202

203+
$this->assertTrue($form->isSubmitted());
204+
$this->assertTrue($form->isSynchronized());
197205
$this->expectNoValidate();
198206

199207
$this->validator->validate($form, new Form());
@@ -216,6 +224,8 @@ public function testDontValidateConstraintsIfNoValidationGroups()
216224
// Launch transformer
217225
$form->submit('foo');
218226

227+
$this->assertTrue($form->isSubmitted());
228+
$this->assertTrue($form->isSynchronized());
219229
$this->expectNoValidate();
220230

221231
$this->validator->validate($form, new Form());
@@ -238,6 +248,8 @@ public function testDontValidateChildConstraintsIfCallableNoValidationGroups()
238248
$form->add($child);
239249
$form->submit([]);
240250

251+
$this->assertTrue($form->isSubmitted());
252+
$this->assertTrue($form->isSynchronized());
241253
$this->expectNoValidate();
242254

243255
$this->validator->validate($form, new Form());
@@ -266,6 +278,8 @@ function () { throw new TransformationFailedException(); }
266278
// Launch transformer
267279
$form->submit('foo');
268280

281+
$this->assertTrue($form->isSubmitted());
282+
$this->assertFalse($form->isSynchronized());
269283
$this->expectNoValidate();
270284

271285
$this->validator->validate($form, new Form());
@@ -301,6 +315,8 @@ function () { throw new TransformationFailedException(); }
301315
// Launch transformer
302316
$form->submit('foo');
303317

318+
$this->assertTrue($form->isSubmitted());
319+
$this->assertFalse($form->isSynchronized());
304320
$this->expectNoValidate();
305321

306322
$this->validator->validate($form, new Form());
@@ -412,6 +428,8 @@ function () { throw new TransformationFailedException(); }
412428
// Launch transformer
413429
$form->submit(['child' => 'foo']);
414430

431+
$this->assertTrue($form->isSubmitted());
432+
$this->assertFalse($form->isSynchronized());
415433
$this->expectNoValidate();
416434

417435
$this->validator->validate($form, new Form());
@@ -617,7 +635,10 @@ public function testDontWalkScalars()
617635
$form = $this->getBuilder()
618636
->setData('scalar')
619637
->getForm();
638+
$form->submit('foo');
620639

640+
$this->assertTrue($form->isSubmitted());
641+
$this->assertTrue($form->isSynchronized());
621642
$this->expectNoValidate();
622643

623644
$this->validator->validate($form, new Form());
@@ -635,6 +656,8 @@ public function testViolationIfExtraData()
635656

636657
$form->submit(['foo' => 'bar']);
637658

659+
$this->assertTrue($form->isSubmitted());
660+
$this->assertTrue($form->isSynchronized());
638661
$this->expectNoValidate();
639662

640663
$this->validator->validate($form, new Form());
@@ -656,6 +679,8 @@ public function testViolationFormatIfMultipleExtraFields()
656679

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

682+
$this->assertTrue($form->isSubmitted());
683+
$this->assertTrue($form->isSynchronized());
659684
$this->expectNoValidate();
660685

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

0 commit comments

Comments
 (0)