mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
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
|
||||
{
|
||||
$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;
|
||||
}
|
||||
|
||||
@ -61,6 +61,7 @@ $names = [
|
||||
'Німеччина' => '__pest_evaluable_Німеччина',
|
||||
'Nam Định' => '__pest_evaluable_Nam_Định',
|
||||
'呼和浩特' => '__pest_evaluable_呼和浩特',
|
||||
'test /** with comment */ should do' => '__pest_evaluable_test_____with_comment____should_do',
|
||||
];
|
||||
|
||||
foreach ($names as $name => $methodName) {
|
||||
@ -68,5 +69,6 @@ foreach ($names as $name => $methodName) {
|
||||
->expect(fn () => static::getLatestPrintableTestCaseMethodName())
|
||||
->toBe($name)
|
||||
->and(fn () => $this->name())
|
||||
->toBe($methodName);
|
||||
->toBe($methodName)
|
||||
->only();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user