Refactor tests

This commit is contained in:
Mario Franco 2013-05-03 14:37:52 +01:00
parent 48c65fefc8
commit 1dc3380e8e
3 changed files with 17 additions and 1 deletions

View File

@ -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()

View File

@ -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()
{ {

View File

@ -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: