mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 01:57:13 +00:00
Add tests for new tags
This commit is contained in:
@@ -25,6 +25,7 @@ use phpDocumentor\Reflection\DocBlock\Tags\Param;
|
||||
use phpDocumentor\Reflection\DocBlock\Tags\Return_;
|
||||
use phpDocumentor\Reflection\DocBlock\Tags\See;
|
||||
use phpDocumentor\Reflection\DocBlock\Tags\Since;
|
||||
use phpDocumentor\Reflection\DocBlock\Tags\Template;
|
||||
use phpDocumentor\Reflection\PseudoTypes\ConstExpression;
|
||||
use phpDocumentor\Reflection\Types\Array_;
|
||||
use phpDocumentor\Reflection\Types\Compound;
|
||||
@@ -431,4 +432,35 @@ identifier has already been registered.',
|
||||
$docblock
|
||||
);
|
||||
}
|
||||
|
||||
public function testProcessTemplateTag(): void
|
||||
{
|
||||
$docComment = <<<DOCBLOCK
|
||||
/**
|
||||
* @template T as \Type this is a description
|
||||
* @template TDefault as \Type = \\String_ this is a description
|
||||
*/
|
||||
DOCBLOCK;
|
||||
|
||||
$factory = DocBlockFactory::createInstance();
|
||||
$docblock = $factory->create($docComment);
|
||||
|
||||
self::assertEquals(
|
||||
[
|
||||
new Template(
|
||||
'T',
|
||||
new Object_(new Fqsen('\\Type')),
|
||||
new Mixed_(),
|
||||
new Description('this is a description')
|
||||
),
|
||||
new Template(
|
||||
'TDefault',
|
||||
new Object_(new Fqsen('\\Type')),
|
||||
new Object_(new Fqsen('\\String_')),
|
||||
new Description('this is a description')
|
||||
),
|
||||
],
|
||||
$docblock->getTags()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user