From 0fc00e86a4ed071ba0f6e8733286ae54583a683b Mon Sep 17 00:00:00 2001 From: Vladimir Kovpak Date: Mon, 1 Feb 2016 11:21:59 +0200 Subject: [PATCH] Improve cookbook form unit testing. | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | all | Fixed tickets | #6203| I tweak this example from cookbook, and receive error: ```` Symfony\Component\Form\Exception\UnexpectedTypeException: Expected argument of type "string", "AppBundle\Form\CategoryType" given ```` and i just fix it like in this pr - and all become ok. --- cookbook/form/unit_testing.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cookbook/form/unit_testing.rst b/cookbook/form/unit_testing.rst index f23b78e4a9b..9d4e840d68b 100644 --- a/cookbook/form/unit_testing.rst +++ b/cookbook/form/unit_testing.rst @@ -39,7 +39,6 @@ The simplest ``TypeTestCase`` implementation looks like the following:: // tests/AppBundle/Form/Type/TestedTypeTest.php namespace Tests\AppBundle\Form\Type; - use AppBundle\Form\Type\TestedType; use AppBundle\Model\TestObject; use Symfony\Component\Form\Test\TypeTestCase; @@ -52,7 +51,7 @@ The simplest ``TypeTestCase`` implementation looks like the following:: 'test2' => 'test2', ); - $type = new TestedType(); + $type = 'AppBundle\Form\Type\TestedType'; $form = $this->factory->create($type); $object = TestObject::fromArray($formData);