Fixed tests by adding separate form type

This commit is contained in:
lucasvanlierop 2014-09-30 13:54:30 +02:00
parent f625d9671c
commit b4a6825db7
3 changed files with 30 additions and 2 deletions

View File

@ -67,7 +67,7 @@ class TestController
/**
* @ApiDoc(
* input="Nelmio\ApiDocBundle\Tests\Fixtures\Form\TestType"
* input="Nelmio\ApiDocBundle\Tests\Fixtures\Form\RequiredType"
* )
*/
public function requiredParametersAction()

View File

@ -0,0 +1,29 @@
<?php
namespace Nelmio\ApiDocBundle\Tests\Fixtures\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
/**
* Class SimpleType
*
* @author Lucas van Lierop <lucas@vanlierop.org>
*/
class RequiredType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('required_field', 'text', array('required' => true));
}
/**
* Returns the name of this type.
*
* @return string The name of this type
*/
public function getName()
{
return '';
}
}

View File

@ -27,7 +27,6 @@ class TestType extends AbstractType
->add('b')
->add($builder->create('c', 'checkbox'))
->add('d','text',array( 'data' => 'DefaultTest'))
->add('required_field', 'text', array('required' => true))
;
}