This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/Validator/Tests
Fabien Potencier 1de60c902c merged branch ricardclau/rename_choice_to_oneof (PR #6360)
This PR was merged into the master branch.

Commits
-------

9071676 create oneof constraint and add deprecation messages in choice, also make choice extend new oneOf constraint to avoid duplicate code

Discussion
----------

[Validator] Rename "Choice" to "OneOf"

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #6324
Todo:
License of the code: MIT
Documentation PR: https://github.com/symfony/symfony-docs/issues/2025

---------------------------------------------------------------------------

by bschussek at 2012-12-14T18:20:56Z

Can you let `Choice` and `ChoiceValidator` extend the renamed classes? Then we avoid the code duplication. You can also remove `ChoiceValidatorTest` then.

---------------------------------------------------------------------------

by ricardclau at 2012-12-14T18:26:58Z

For sure! BTW there seems to be a problem with SF2 build when testing BR currency :S maybe it is the new ICU version supported, I guess you are aware of this but just in case!

---------------------------------------------------------------------------

by stof at 2012-12-14T21:14:04Z

the ``Choice`` constraint should trigger a ``E_USER_DEPRECATED`` in its constructor (and calling the parent constructor) as we agreed on this. The PR adding these calls everywhere is not merged yet, but it would avoid missing it when merging the PRs separately

---------------------------------------------------------------------------

by bschussek at 2012-12-14T21:19:45Z

Things missing:

* add a deprecation note to the Validator's CHANGELOG
* add a block in UPGRADE-2.2 under the Validator's "Deprecations" section that explains how to upgrade with a before/after sample
* add `trigger_error()` calls to the constructors of `Choice` and `ChoiceValidator`

See #6180 for more information about how to call `trigger_error()`.

---------------------------------------------------------------------------

by ricardclau at 2012-12-14T22:45:55Z

Sorry I was not aware of the trigger_error() agreement, absolutely +1 on it.

I hope I understood everything properly, if there is something else or some other errors please tell me!

---------------------------------------------------------------------------

by bschussek at 2012-12-15T08:46:51Z

The entry in the CHANGELOG is still missing.

---------------------------------------------------------------------------

by ricardclau at 2012-12-15T09:36:28Z

By the CHANGELOG you mean what I just added right? Hope now it is ok!

---------------------------------------------------------------------------

by bschussek at 2012-12-15T09:45:16Z

Awesome! 👍
2012-12-15 13:25:28 +01:00
..
Constraints merged branch ricardclau/rename_choice_to_oneof (PR #6360) 2012-12-15 13:25:28 +01:00
Fixtures [Validator] Refactored the GraphWalker into an implementation of the Visitor design pattern. 2012-11-24 13:00:28 +01:00
Mapping [Validator] Refactored the GraphWalker into an implementation of the Visitor design pattern. 2012-11-24 13:00:28 +01:00
ConstraintTest.php moved component and bridge unit tests to the src/ directory 2012-03-29 08:37:22 +02:00
ConstraintValidatorTest.php [Form] Catch deprecation errors when using deprecated methods/classes in tests 2012-12-06 21:24:00 +01:00
ConstraintViolationListTest.php moved component and bridge unit tests to the src/ directory 2012-03-29 08:37:22 +02:00
ConstraintViolationTest.php moved component and bridge unit tests to the src/ directory 2012-03-29 08:37:22 +02:00
ExecutionContextTest.php [Validator] Refactored the GraphWalker into an implementation of the Visitor design pattern. 2012-11-24 13:00:28 +01:00
GraphWalkerTest.php [Validator] Refactored the GraphWalker into an implementation of the Visitor design pattern. 2012-11-24 13:00:28 +01:00
ValidationVisitorTest.php [Validator] Fixed: Arrays are validated recursively by default 2012-12-13 15:47:07 +01:00
ValidatorBuilderTest.php added tests for ValidatorBuilder fluent interface 2012-08-25 18:16:50 +02:00
ValidatorContextTest.php [Validator] Refactored the GraphWalker into an implementation of the Visitor design pattern. 2012-11-24 13:00:28 +01:00
ValidatorFactoryTest.php [Validator] Refactored the GraphWalker into an implementation of the Visitor design pattern. 2012-11-24 13:00:28 +01:00
ValidatorTest.php [Validator] Refactored the GraphWalker into an implementation of the Visitor design pattern. 2012-11-24 13:00:28 +01:00