mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
Fixed tests by adding separate form type
This commit is contained in:
parent
f625d9671c
commit
b4a6825db7
@ -67,7 +67,7 @@ class TestController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @ApiDoc(
|
* @ApiDoc(
|
||||||
* input="Nelmio\ApiDocBundle\Tests\Fixtures\Form\TestType"
|
* input="Nelmio\ApiDocBundle\Tests\Fixtures\Form\RequiredType"
|
||||||
* )
|
* )
|
||||||
*/
|
*/
|
||||||
public function requiredParametersAction()
|
public function requiredParametersAction()
|
||||||
|
29
Tests/Fixtures/Form/RequiredType.php
Normal file
29
Tests/Fixtures/Form/RequiredType.php
Normal 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 '';
|
||||||
|
}
|
||||||
|
}
|
@ -27,7 +27,6 @@ class TestType extends AbstractType
|
|||||||
->add('b')
|
->add('b')
|
||||||
->add($builder->create('c', 'checkbox'))
|
->add($builder->create('c', 'checkbox'))
|
||||||
->add('d','text',array( 'data' => 'DefaultTest'))
|
->add('d','text',array( 'data' => 'DefaultTest'))
|
||||||
->add('required_field', 'text', array('required' => true))
|
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user