From 65345912a9919335e6183487150066f3397c3b2a Mon Sep 17 00:00:00 2001 From: mRoca Date: Tue, 9 Jun 2015 15:33:22 +0200 Subject: [PATCH] Add DunglasApiBundle doc sections --- .../DunglasApiProvider.php | 1 + Tests/Formatter/MarkdownFormatterTest.php | 165 +++++++++--------- Tests/Formatter/SimpleFormatterTest.php | 5 + 3 files changed, 90 insertions(+), 81 deletions(-) diff --git a/Extractor/AnnotationsProvider/DunglasApiProvider.php b/Extractor/AnnotationsProvider/DunglasApiProvider.php index b317c5d..c80bd4e 100644 --- a/Extractor/AnnotationsProvider/DunglasApiProvider.php +++ b/Extractor/AnnotationsProvider/DunglasApiProvider.php @@ -114,6 +114,7 @@ class DunglasApiProvider implements AnnotationsProviderInterface 'resource' => $route->getPath(), 'description' => $operationHydraDoc['hydra:title'], 'resourceDescription' => $resourceHydraDoc['hydra:title'], + 'section' => $resourceHydraDoc['hydra:title'], ]; $entityClass = $resource->getEntityClass(); diff --git a/Tests/Formatter/MarkdownFormatterTest.php b/Tests/Formatter/MarkdownFormatterTest.php index f441c65..28f456e 100644 --- a/Tests/Formatter/MarkdownFormatterTest.php +++ b/Tests/Formatter/MarkdownFormatterTest.php @@ -27,6 +27,90 @@ class MarkdownFormatterTest extends WebTestCase if (class_exists('Dunglas\ApiBundle\DunglasApiBundle')) { $expected = << false, 'resourceDescription' => 'Popo', + 'section' => 'Popo', ), 8 => array ( @@ -1668,6 +1669,7 @@ And, it supports multilines until the first \'@\' char.', ), 'deprecated' => false, 'resourceDescription' => 'Popo', + 'section' => 'Popo', ), 9 => array ( @@ -1701,6 +1703,7 @@ And, it supports multilines until the first \'@\' char.', ), 'deprecated' => false, 'resourceDescription' => 'Popo', + 'section' => 'Popo', ), 10 => array ( @@ -1744,6 +1747,7 @@ And, it supports multilines until the first \'@\' char.', ), 'deprecated' => false, 'resourceDescription' => 'Popo', + 'section' => 'Popo', ), 11 => array ( @@ -1767,6 +1771,7 @@ And, it supports multilines until the first \'@\' char.', ), 'deprecated' => false, 'resourceDescription' => 'Popo', + 'section' => 'Popo', ), 12 => array (