mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 23:59:26 +03:00
Test FOSRestBundle support
This commit is contained in:
parent
f6f91562d9
commit
da6527060f
@ -11,6 +11,8 @@
|
||||
|
||||
namespace EXSyst\Bundle\ApiDocBundle\Tests\Functional\Controller;
|
||||
|
||||
use FOS\RestBundle\Controller\Annotations\QueryParam;
|
||||
use FOS\RestBundle\Controller\Annotations\RequestParam;
|
||||
use Nelmio\ApiDocBundle\Annotation\ApiDoc;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
||||
|
||||
@ -26,6 +28,15 @@ class ApiController
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/fosrest", methods={"POST"})
|
||||
* @QueryParam(name="foo")
|
||||
* @RequestParam(name="bar")
|
||||
*/
|
||||
public function fosrestAction()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/nelmio/{foo}", methods={"POST"})
|
||||
* @ApiDoc(
|
||||
|
@ -40,6 +40,15 @@ class FunctionalTest extends WebTestCase
|
||||
$this->assertEquals('/foo/', $parameter->getFormat());
|
||||
}
|
||||
|
||||
public function testFOSRestAction()
|
||||
{
|
||||
$operation = $this->getOperation('/api/fosrest', 'post');
|
||||
|
||||
$parameters = $operation->getParameters();
|
||||
$this->assertTrue($parameters->has('foo', 'query'));
|
||||
$this->assertTrue($parameters->has('bar', 'formData'));
|
||||
}
|
||||
|
||||
public function testNelmioAction()
|
||||
{
|
||||
$operation = $this->getOperation('/api/nelmio/{foo}', 'post');
|
||||
|
Loading…
x
Reference in New Issue
Block a user