Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ba34459

Browse files
committed
feature #17203 Move Constraint validator test case to Test namespace (WouterJ)
This PR was merged into the 3.2-dev branch. Discussion ---------- Move Constraint validator test case to Test namespace | Q | A | ------------- | --- | Bug fix? | no | New feature? | kinda | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - The Validator component has a very usefull test utility to test constraint validators. It's only hidden deep in the Tests namespace. Just as was done with the TypeTestCase of the Form component some years ago, I think it's usefull to move the constraint test case to the Test namespace as well. *Btw, my last PR of the year and the first deprecation of 3.1* 🎆 Commits ------- e938361 Move Constraint validator test case to Test namespace
2 parents 1e263c0 + e938361 commit ba34459

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+482
-360
lines changed

UPGRADE-3.2.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,33 @@ DependencyInjection
66

77
* Calling `get()` on a `ContainerBuilder` instance before compiling the
88
container is deprecated and will throw an exception in Symfony 4.0.
9+
10+
Validator
11+
---------
12+
13+
* `Tests\Constraints\AbstractConstraintValidatorTest` has been deprecated in
14+
favor of `Test\ConstraintValidatorTestCase`.
15+
16+
Before:
17+
18+
```php
19+
// ...
20+
use Symfony\Component\Validator\Tests\Constraints\AbstractConstraintValidatorTest;
21+
22+
class MyCustomValidatorTest extends AbstractConstraintValidatorTest
23+
{
24+
// ...
25+
}
26+
```
27+
28+
After:
29+
30+
```php
31+
// ...
32+
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
33+
34+
class MyCustomValidatorTest extends ConstraintValidatorTestCase
35+
{
36+
// ...
37+
}
38+
```

UPGRADE-4.0.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,30 @@ Validator
199199
---------
200200

201201
* The `DateTimeValidator::PATTERN` constant was removed.
202+
203+
* `Tests\Constraints\AbstractConstraintValidatorTest` has been removed in
204+
favor of `Test\ConstraintValidatorTestCase`.
205+
206+
Before:
207+
208+
```php
209+
// ...
210+
use Symfony\Component\Validator\Tests\Constraints\AbstractConstraintValidatorTest;
211+
212+
class MyCustomValidatorTest extends AbstractConstraintValidatorTest
213+
{
214+
// ...
215+
}
216+
```
217+
218+
After:
219+
220+
```php
221+
// ...
222+
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
223+
224+
class MyCustomValidatorTest extends ConstraintValidatorTestCase
225+
{
226+
// ...
227+
}
228+
```

src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626

2727
/**
2828
* @author Bernhard Schussek <[email protected]>
29+
*
30+
* @todo use ConstraintValidatorTestCase when symfony/validator ~3.2 is required.
2931
*/
3032
class UniqueEntityValidatorTest extends AbstractConstraintValidatorTest
3133
{

src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@
2121
use Symfony\Component\Validator\Constraints\NotNull;
2222
use Symfony\Component\Validator\Constraints\NotBlank;
2323
use Symfony\Component\Validator\Constraints\Valid;
24-
use Symfony\Component\Validator\ExecutionContextInterface;
2524
use Symfony\Component\Validator\Tests\Constraints\AbstractConstraintValidatorTest;
2625

2726
/**
2827
* @author Bernhard Schussek <[email protected]>
28+
*
29+
* @todo use ConstraintValidatorTestCase when symfony/validator ~3.2 is required.
2930
*/
3031
class FormValidatorTest extends AbstractConstraintValidatorTest
3132
{

src/Symfony/Component/Validator/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
3.2.0
5+
-----
6+
7+
* deprecated `Tests\Constraints\AbstractContraintValidatorTest` in favor of `Test\ConstraintValidatorTestCase`
8+
49
3.1.0
510
-----
611

0 commit comments

Comments
 (0)