Fix tests, fix markdown/html requirements output

This commit is contained in:
William DURAND 2012-07-20 02:02:45 +02:00
parent cca97cf6af
commit a8e0b24b95
3 changed files with 14 additions and 13 deletions

View File

@ -46,6 +46,7 @@ class MarkdownFormatter extends AbstractFormatter
if (!empty($infos['type'])) {
$markdown .= sprintf(" - Type: %s\n", $infos['type']);
}
if (!empty($infos['description'])) {
$markdown .= sprintf(" - Description: %s\n", $infos['description']);
}
@ -61,7 +62,7 @@ class MarkdownFormatter extends AbstractFormatter
$markdown .= sprintf("%s:\n\n", $name);
foreach ($filter as $key => $value) {
$markdown .= sprintf(" * %s: %s\n", $key, trim(json_encode($value), '"'));
$markdown .= sprintf(" * %s: %s\n", ucwords($key), trim(str_replace('\\\\', '\\', json_encode($value)), '"'));
}
$markdown .= "\n";

View File

@ -72,7 +72,7 @@
{% for key, value in infos %}
<tr>
<td>{{ key|title }}</td>
<td>{{ value|json_encode|trim('"') }}</td>
<td>{{ value|json_encode|replace({'\\\\': '\\'})|trim('"') }}</td>
</tr>
{% endfor %}
</table>

View File

@ -34,12 +34,12 @@ _index action_
a:
* dataType: integer
* DataType: integer
b:
* dataType: string
* arbitrary: ["arg1","arg2"]
* DataType: string
* Arbitrary: ["arg1","arg2"]
### `GET` /tests ###
@ -50,12 +50,12 @@ _index action_
a:
* dataType: integer
* DataType: integer
b:
* dataType: string
* arbitrary: ["arg1","arg2"]
* DataType: string
* Arbitrary: ["arg1","arg2"]
### `POST` /tests ###
@ -167,8 +167,8 @@ _This method is useful to test if the getDocComment works._
page:
* requirement: \d+
* description: Page of the overview.
* Requirement: \d+
* Description: Page of the overview.
MARKDOWN;
$this->assertEquals($expected, $result);
@ -191,12 +191,12 @@ _index action_
a:
* dataType: integer
* DataType: integer
b:
* dataType: string
* arbitrary: ["arg1","arg2"]
* DataType: string
* Arbitrary: ["arg1","arg2"]
MARKDOWN;