Skip to content

Commit

Permalink
feature #17203 Move Constraint validator test case to Test namespace …
Browse files Browse the repository at this point in the history
…(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
  • Loading branch information
fabpot committed Jun 15, 2016
2 parents 1e263c0 + e938361 commit ba34459
Show file tree
Hide file tree
Showing 43 changed files with 482 additions and 360 deletions.
30 changes: 30 additions & 0 deletions UPGRADE-3.2.md
Expand Up @@ -6,3 +6,33 @@ DependencyInjection

* Calling `get()` on a `ContainerBuilder` instance before compiling the
container is deprecated and will throw an exception in Symfony 4.0.

Validator
---------

* `Tests\Constraints\AbstractConstraintValidatorTest` has been deprecated in
favor of `Test\ConstraintValidatorTestCase`.

Before:

```php
// ...
use Symfony\Component\Validator\Tests\Constraints\AbstractConstraintValidatorTest;

class MyCustomValidatorTest extends AbstractConstraintValidatorTest
{
// ...
}
```

After:

```php
// ...
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;

class MyCustomValidatorTest extends ConstraintValidatorTestCase
{
// ...
}
```
27 changes: 27 additions & 0 deletions UPGRADE-4.0.md
Expand Up @@ -199,3 +199,30 @@ Validator
---------

* The `DateTimeValidator::PATTERN` constant was removed.

* `Tests\Constraints\AbstractConstraintValidatorTest` has been removed in
favor of `Test\ConstraintValidatorTestCase`.

Before:

```php
// ...
use Symfony\Component\Validator\Tests\Constraints\AbstractConstraintValidatorTest;

class MyCustomValidatorTest extends AbstractConstraintValidatorTest
{
// ...
}
```

After:

```php
// ...
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;

class MyCustomValidatorTest extends ConstraintValidatorTestCase
{
// ...
}
```
Expand Up @@ -26,6 +26,8 @@

/**
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @todo use ConstraintValidatorTestCase when symfony/validator ~3.2 is required.
*/
class UniqueEntityValidatorTest extends AbstractConstraintValidatorTest
{
Expand Down
Expand Up @@ -21,11 +21,12 @@
use Symfony\Component\Validator\Constraints\NotNull;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\Valid;
use Symfony\Component\Validator\ExecutionContextInterface;
use Symfony\Component\Validator\Tests\Constraints\AbstractConstraintValidatorTest;

/**
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @todo use ConstraintValidatorTestCase when symfony/validator ~3.2 is required.
*/
class FormValidatorTest extends AbstractConstraintValidatorTest
{
Expand Down
5 changes: 5 additions & 0 deletions src/Symfony/Component/Validator/CHANGELOG.md
@@ -1,6 +1,11 @@
CHANGELOG
=========

3.2.0
-----

* deprecated `Tests\Constraints\AbstractContraintValidatorTest` in favor of `Test\ConstraintValidatorTestCase`

3.1.0
-----

Expand Down

0 comments on commit ba34459

Please sign in to comment.