Updated code to pass the tests

This commit is contained in:
Samuel Gordalina 2012-07-13 14:07:40 +01:00 committed by William DURAND
parent f247d6af92
commit 07e6a19dd4
4 changed files with 10 additions and 2 deletions

View File

@ -233,7 +233,7 @@ class ApiDocExtractor
$comment = preg_replace('/^\s*\* ?/m', '', $comment); $comment = preg_replace('/^\s*\* ?/m', '', $comment);
// Remove everything (and including) first annotation // Remove everything (and including) first annotation
$comment = preg_replace('/\n?\s*@[^\s]+.+/ms', '', $comment); $comment = preg_replace('/@[\w0-9]+\(.*/msi', '', $comment);
return trim($comment); return trim($comment);
} }

View File

@ -30,8 +30,10 @@ class MarkdownFormatter extends AbstractFormatter
$markdown .= "#### Documentation ####\n\n"; $markdown .= "#### Documentation ####\n\n";
foreach (explode("\n", $data['documentation']) as $line) { foreach (explode("\n", $data['documentation']) as $line) {
$markdown .= "\t" . $line . "\n"; $markdown .= " " . $line . "\n";
} }
$markdown .= "\n";
} }
if (isset($data['requirements']) && !empty($data['requirements'])) { if (isset($data['requirements']) && !empty($data['requirements'])) {

View File

@ -126,6 +126,11 @@ _Action without HTTP verb_
_This method is useful to test if the getDocComment works. And, it supports multilines until the first '@' char._ _This method is useful to test if the getDocComment works. And, it supports multilines until the first '@' char._
#### Documentation ####
This method is useful to test if the getDocComment works.
And, it supports multilines until the first '@' char.
#### Requirements #### #### Requirements ####
**id** **id**

View File

@ -168,6 +168,7 @@ class SimpleFormatterTest extends WebTestCase
'page' => array('type' => 'int', 'description' => '', 'value' => ''), 'page' => array('type' => 'int', 'description' => '', 'value' => ''),
), ),
'description' => 'This method is useful to test if the getDocComment works. And, it supports multilines until the first \'@\' char.', 'description' => 'This method is useful to test if the getDocComment works. And, it supports multilines until the first \'@\' char.',
'documentation' => "This method is useful to test if the getDocComment works.\nAnd, it supports multilines until the first '@' char."
), ),
3 => 3 =>
array( array(