Skip to content

Commit

Permalink
Merge branch '3.4' into 4.3
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
nicolas-grekas committed Jan 4, 2020
2 parents bc319f1 + 99f6cf6 commit 05fac49
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 @@ -133,7 +133,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 @@ -188,10 +191,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 @@ -214,6 +222,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 @@ -236,6 +246,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 @@ -264,6 +276,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 @@ -299,6 +313,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 @@ -410,6 +426,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 @@ -615,7 +633,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 @@ -633,6 +654,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 @@ -654,6 +677,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 05fac49

Please sign in to comment.