Skip to content

Commit d47e616

Browse files
committed
[#5962] Update related paragraph
1 parent 4b5dfa5 commit d47e616

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

cookbook/form/unit_testing.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,17 @@ before creating the parent form using the ``PreloadedExtension`` class::
158158
be getting errors that are not related to the form you are currently
159159
testing but to its children.
160160

161-
Adding custom Extensions
161+
Adding Custom Extensions
162162
------------------------
163163

164164
It often happens that you use some options that are added by
165165
:doc:`form extensions </cookbook/form/create_form_type_extension>`. One of the
166166
cases may be the ``ValidatorExtension`` with its ``invalid_message`` option.
167-
The ``TypeTestCase`` loads only the core form extension so an "Invalid option"
168-
exception will be raised if you try to use it for testing a class that depends
169-
on other extensions. You need to add those extensions to the factory object::
167+
The ``TypeTestCase`` only loads the core form extension, which means an
168+
"Invalid option" exception will be raised if you try to test a class that
169+
depends on other extensions. The
170+
:method:`Symfony\Component\Form\Test\TypeTestCase::getExtensions` allows you to
171+
return a list of extensions to register::
170172

171173
// src/AppBundle/Tests/Form/Type/TestedTypeTests.php
172174
namespace AppBundle\Tests\Form\Type;
@@ -194,7 +196,7 @@ on other extensions. You need to add those extensions to the factory object::
194196
// ... your tests
195197
}
196198

197-
Testing against different Sets of Data
199+
Testing against Different Sets of Data
198200
--------------------------------------
199201

200202
If you are not familiar yet with PHPUnit's `data providers`_, this might be

0 commit comments

Comments
 (0)