How to load form types in tests
问题 <?php namespace Tabl\VenueBundle\Tests\Form; use Symfony\Component\Form\Test\TypeTestCase; use Tabl\VenueBundle\Entity\Venue; use Tabl\VenueBundle\Form\VenueType; class VenueTypeTest extends TypeTestCase { public function testSubmitValidData() { $formData = array( 'title' => 'Hello World', ); $type = new VenueType(); $form = $this->factory->create($type); $object = new Venue(); $object->setTitle('Hello World'); // submit the data to the form directly $form->submit($formData); $this-