mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-09 02:59:27 +03:00
Refactor tests
This commit is contained in:
parent
48c65fefc8
commit
1dc3380e8e
@ -153,6 +153,20 @@ class ApiDocExtractorTest extends WebTestCase
|
|||||||
"This method is useful to test if the getDocComment works.",
|
"This method is useful to test if the getDocComment works.",
|
||||||
$annotation->getDescription()
|
$annotation->getDescription()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$data = $annotation->toArray();
|
||||||
|
$this->assertEquals(
|
||||||
|
4,
|
||||||
|
count($data['requirements'])
|
||||||
|
);
|
||||||
|
$this->assertEquals(
|
||||||
|
'The param type',
|
||||||
|
$data['requirements']['paramType']['description']
|
||||||
|
);
|
||||||
|
$this->assertEquals(
|
||||||
|
'The param id',
|
||||||
|
$data['requirements']['param']['description']
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetWithAuthentication()
|
public function testGetWithAuthentication()
|
||||||
|
@ -73,6 +73,8 @@ class TestController
|
|||||||
*
|
*
|
||||||
* @param int $id A nice comment
|
* @param int $id A nice comment
|
||||||
* @param int $page
|
* @param int $page
|
||||||
|
* @param int $paramType The param type
|
||||||
|
* @param int $param The param id
|
||||||
*/
|
*/
|
||||||
public function myCommentedAction()
|
public function myCommentedAction()
|
||||||
{
|
{
|
||||||
|
@ -20,7 +20,7 @@ test_route_4:
|
|||||||
defaults: { _controller: NelmioApiDocTestBundle:Test:any, _format: json }
|
defaults: { _controller: NelmioApiDocTestBundle:Test:any, _format: json }
|
||||||
|
|
||||||
test_route_5:
|
test_route_5:
|
||||||
pattern: /my-commented/{id}/{page}
|
pattern: /my-commented/{id}/{page}/{paramType}/{param}
|
||||||
defaults: { _controller: NelmioApiDocTestBundle:Test:myCommented }
|
defaults: { _controller: NelmioApiDocTestBundle:Test:myCommented }
|
||||||
|
|
||||||
test_route_6:
|
test_route_6:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user