Skip to content

Commit

Permalink
Merge branch '4.4' into 5.0
Browse files Browse the repository at this point in the history
* 4.4: (26 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
  [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
  [TwigBridge][Form] Added missing help messages in form themes
  Update year in license files
  Update year in license files
  fix version when "anonymous: lazy" was introduced
  ...
  • Loading branch information
nicolas-grekas committed Jan 4, 2020
2 parents c57a9fe + 442d561 commit c96f80b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2004-2019 Fabien Potencier
Copyright (c) 2004-2020 Fabien Potencier

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The Form component allows you to easily create, process and reuse HTML forms.
Resources
---------

* [Documentation](https://symfony.com/doc/current/components/form/index.html)
* [Documentation](https://symfony.com/doc/current/components/form.html)
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
* [Report issues](https://github.com/symfony/symfony/issues) and
[send Pull Requests](https://github.com/symfony/symfony/pulls)
Expand Down
25 changes: 25 additions & 0 deletions Tests/Extension/Validator/Constraints/FormValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@ public function testDontValidateIfParentWithoutValidConstraint()
$parent->add($form);

$form->setData($object);
$parent->submit([]);

$this->assertTrue($form->isSubmitted());
$this->assertTrue($form->isSynchronized());
$this->expectNoValidate();

$this->validator->validate($form, new Form());
Expand Down Expand Up @@ -190,10 +193,15 @@ public function testDontValidateIfNoValidationGroups()
'validation_groups' => [],
])
->setData($object)
->setCompound(true)
->setDataMapper(new PropertyPathMapper())
->getForm();

$form->setData($object);
$form->submit([]);

$this->assertTrue($form->isSubmitted());
$this->assertTrue($form->isSynchronized());
$this->expectNoValidate();

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

$this->assertTrue($form->isSubmitted());
$this->assertTrue($form->isSynchronized());
$this->expectNoValidate();

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

$this->assertTrue($form->isSubmitted());
$this->assertTrue($form->isSynchronized());
$this->expectNoValidate();

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

$this->assertTrue($form->isSubmitted());
$this->assertFalse($form->isSynchronized());
$this->expectNoValidate();

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

$this->assertTrue($form->isSubmitted());
$this->assertFalse($form->isSynchronized());
$this->expectNoValidate();

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

$this->assertTrue($form->isSubmitted());
$this->assertFalse($form->isSynchronized());
$this->expectNoValidate();

$this->validator->validate($form, new Form());
Expand Down Expand Up @@ -617,7 +635,10 @@ public function testDontWalkScalars()
$form = $this->getBuilder()
->setData('scalar')
->getForm();
$form->submit('foo');

$this->assertTrue($form->isSubmitted());
$this->assertTrue($form->isSynchronized());
$this->expectNoValidate();

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

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

$this->assertTrue($form->isSubmitted());
$this->assertTrue($form->isSynchronized());
$this->expectNoValidate();

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

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

$this->assertTrue($form->isSubmitted());
$this->assertTrue($form->isSynchronized());
$this->expectNoValidate();

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

0 comments on commit c96f80b

Please sign in to comment.