Skip to content

[WCM] Renamed TypeTestCase namespace #2500

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 1 commit into from
May 3, 2013
Merged
Changes from all commits
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
21 changes: 10 additions & 11 deletions cookbook/form/unit_testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ is done in a real application. It is simple to bootstrap and you can trust
the Symfony components enough to use them as a testing base.

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

.. note::

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

The Basics
----------
Expand All @@ -36,7 +35,7 @@ The simplest ``TypeTestCase`` implementation looks like the following::

use Acme\TestBundle\Form\Type\TestedType;
use Acme\TestBundle\Model\TestObject;
use Symfony\Component\Form\Tests\Extension\Core\Type\TypeTestCase;
use Symfony\Component\Form\Test\TypeTestCase;

class TestedTypeTest extends TypeTestCase
{
Expand Down Expand Up @@ -124,7 +123,7 @@ before creating the parent form::

use Acme\TestBundle\Form\Type\TestedType;
use Acme\TestBundle\Model\TestObject;
use Symfony\Component\Form\Tests\Extension\Core\Type\TypeTestCase;
use Symfony\Component\Form\Test\TypeTestCase;

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

use Acme\TestBundle\Form\Type\TestedType;
use Acme\TestBundle\Model\TestObject;
use Symfony\Component\Form\Tests\Extension\Core\Type\TypeTestCase;
use Symfony\Component\Form\Test\TypeTestCase;

class TestedTypeTest extends TypeTestCase
{
Expand Down Expand Up @@ -201,7 +200,7 @@ a good opportunity to use them::

use Acme\TestBundle\Form\Type\TestedType;
use Acme\TestBundle\Model\TestObject;
use Symfony\Component\Form\Tests\Extension\Core\Type\TypeTestCase;
use Symfony\Component\Form\Test\TypeTestCase;

class TestedTypeTest extends TypeTestCase
{
Expand Down