mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
Merge pull request #783 from fabio-ivona/fix-comments-in-test-name
fix comments in dokblocks
This commit is contained in:
@ -14,7 +14,17 @@ final class TestDox implements AddsAnnotations
|
|||||||
*/
|
*/
|
||||||
public function __invoke(TestCaseMethodFactory $method, array $annotations): array
|
public function __invoke(TestCaseMethodFactory $method, array $annotations): array
|
||||||
{
|
{
|
||||||
$annotations[] = "@testdox $method->description";
|
/*
|
||||||
|
* escapes docblock according to
|
||||||
|
* https://manual.phpdoc.org/HTMLframesConverter/default/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#basics.desc
|
||||||
|
*
|
||||||
|
* note: '@' escaping is not needed as it cannot be the first character of the line (it always starts with @testdox
|
||||||
|
*/
|
||||||
|
|
||||||
|
assert($method->description !== null);
|
||||||
|
$methodDescription = str_replace('*/', '{@*}', $method->description);
|
||||||
|
|
||||||
|
$annotations[] = "@testdox $methodDescription";
|
||||||
|
|
||||||
return $annotations;
|
return $annotations;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,6 +61,7 @@ $names = [
|
|||||||
'Німеччина' => '__pest_evaluable_Німеччина',
|
'Німеччина' => '__pest_evaluable_Німеччина',
|
||||||
'Nam Định' => '__pest_evaluable_Nam_Định',
|
'Nam Định' => '__pest_evaluable_Nam_Định',
|
||||||
'呼和浩特' => '__pest_evaluable_呼和浩特',
|
'呼和浩特' => '__pest_evaluable_呼和浩特',
|
||||||
|
'test /** with comment */ should do' => '__pest_evaluable_test_____with_comment____should_do',
|
||||||
];
|
];
|
||||||
|
|
||||||
foreach ($names as $name => $methodName) {
|
foreach ($names as $name => $methodName) {
|
||||||
|
|||||||
Reference in New Issue
Block a user