Skip to content

Commit fee3675

Browse files
committed
Renamed TypeTestCase namespace
1 parent 1dcfe8d commit fee3675

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

cookbook/form/unit_testing.rst

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@ is done in a real application. It is simple to bootstrap and you can trust
1717
the Symfony components enough to use them as a testing base.
1818

1919
There is already a class that you can benefit from for simple FormTypes
20-
testing: :class:`Symfony\\Component\\Form\\Tests\\Extension\\Core\\Type\\TypeTestCase`.
21-
It is used to test the core types and you can use it to test your types too.
20+
testing: :class:`Symfony\\Component\\Form\\Test\\TypeTestCase`. It is used to
21+
test the core types and you can use it to test your types too.
2222

23-
.. note::
24-
25-
Depending on the way you installed your Symfony or Symfony Form Component
26-
the tests may not be downloaded. Use the --prefer-source option with
27-
composer if this is the case.
23+
.. versionadded:: 2.3
24+
The ``TypeTestCase`` has moved to the ``Symfony\Component\Form\Test``
25+
namespace in 2.3. Previously, the class was located in
26+
``Symfony\Component\Form\Tests\Core\Extension\Type``.
2827

2928
The Basics
3029
----------
@@ -36,7 +35,7 @@ The simplest ``TypeTestCase`` implementation looks like the following::
3635

3736
use Acme\TestBundle\Form\Type\TestedType;
3837
use Acme\TestBundle\Model\TestObject;
39-
use Symfony\Component\Form\Tests\Extension\Core\Type\TypeTestCase;
38+
use Symfony\Component\Form\Test\TypeTestCase;
4039

4140
class TestedTypeTest extends TypeTestCase
4241
{
@@ -124,7 +123,7 @@ before creating the parent form::
124123

125124
use Acme\TestBundle\Form\Type\TestedType;
126125
use Acme\TestBundle\Model\TestObject;
127-
use Symfony\Component\Form\Tests\Extension\Core\Type\TypeTestCase;
126+
use Symfony\Component\Form\Test\TypeTestCase;
128127

129128
class TestedTypeTest extends TypeTestCase
130129
{
@@ -160,7 +159,7 @@ on other extensions. You need add those extensions to the factory object::
160159

161160
use Acme\TestBundle\Form\Type\TestedType;
162161
use Acme\TestBundle\Model\TestObject;
163-
use Symfony\Component\Form\Tests\Extension\Core\Type\TypeTestCase;
162+
use Symfony\Component\Form\Test\TypeTestCase;
164163

165164
class TestedTypeTest extends TypeTestCase
166165
{
@@ -201,7 +200,7 @@ a good opportunity to use them::
201200

202201
use Acme\TestBundle\Form\Type\TestedType;
203202
use Acme\TestBundle\Model\TestObject;
204-
use Symfony\Component\Form\Tests\Extension\Core\Type\TypeTestCase;
203+
use Symfony\Component\Form\Test\TypeTestCase;
205204

206205
class TestedTypeTest extends TypeTestCase
207206
{

0 commit comments

Comments
 (0)