10000 Added note about using the Validator TypeTestCase in form unit testing by pierredup · Pull Request #7587 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Added note about using the Validator TypeTestCase in form unit testing #7587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jan 10, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove section about forms using validation
  • Loading branch information
pierredup committed Jun 24, 2017
commit f0887ae0c6b9ed6cedbbf8c2ce16aba5ecfb4785
18 changes: 0 additions & 18 deletions form/unit_testing.rst
992F
Original file line number Diff line number Diff line change
Expand Up @@ -157,24 +157,6 @@ before creating the parent form using the ``PreloadedExtension`` class::
be getting errors that are not related to the form you are currently
testing but to its children.

Forms Using Validation
----------------------

If your form uses the ``invalid_message`` or ``constraints`` option for validation, you need to
register the validation extension which provides these options.
Luckily Symfony provides a base test class which takes care of it, just extend
``Symfony\Component\Form\Tests\Extension\Validator\Type\TypeTestCase``::

// tests/AppBundle/Form/Type/TestedTypeTest.php
namespace Tests\AppBundle\Form\Type;

use Symfony\Component\Form\Tests\Extension\Validator\Type\TypeTestCase;

class TestedTypeTest extends TypeTestCase
{
// ...
}

Adding Custom Extensions
------------------------

Expand Down
0