mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 10:07:12 +00:00
Add test for constant references.
This commit is contained in:
@@ -21,9 +21,13 @@ use phpDocumentor\Reflection\DocBlock\Tags\InvalidTag;
|
|||||||
use phpDocumentor\Reflection\DocBlock\Tags\Method;
|
use phpDocumentor\Reflection\DocBlock\Tags\Method;
|
||||||
use phpDocumentor\Reflection\DocBlock\Tags\MethodParameter;
|
use phpDocumentor\Reflection\DocBlock\Tags\MethodParameter;
|
||||||
use phpDocumentor\Reflection\DocBlock\Tags\Param;
|
use phpDocumentor\Reflection\DocBlock\Tags\Param;
|
||||||
|
use phpDocumentor\Reflection\DocBlock\Tags\Return_;
|
||||||
use phpDocumentor\Reflection\DocBlock\Tags\See;
|
use phpDocumentor\Reflection\DocBlock\Tags\See;
|
||||||
|
use phpDocumentor\Reflection\PseudoTypes\ConstExpression;
|
||||||
use phpDocumentor\Reflection\Types\Array_;
|
use phpDocumentor\Reflection\Types\Array_;
|
||||||
use phpDocumentor\Reflection\Types\Integer;
|
use phpDocumentor\Reflection\Types\Integer;
|
||||||
|
use phpDocumentor\Reflection\Types\Mixed_;
|
||||||
|
use phpDocumentor\Reflection\Types\Self_;
|
||||||
use phpDocumentor\Reflection\Types\String_;
|
use phpDocumentor\Reflection\Types\String_;
|
||||||
use phpDocumentor\Reflection\Types\Void_;
|
use phpDocumentor\Reflection\Types\Void_;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
@@ -245,4 +249,23 @@ DOC;
|
|||||||
$docblock->getTags()
|
$docblock->getTags()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testConstantReferenceTypes(): void
|
||||||
|
{
|
||||||
|
$docCommment = <<<DOC
|
||||||
|
/**
|
||||||
|
* @return self::STATUS_*
|
||||||
|
*/
|
||||||
|
DOC;
|
||||||
|
|
||||||
|
$factory = DocBlockFactory::createInstance();
|
||||||
|
$docblock = $factory->create($docCommment);
|
||||||
|
|
||||||
|
self::assertEquals(
|
||||||
|
[
|
||||||
|
new Return_(new ConstExpression(new Self_(), 'STATUS_*'), new Description('')),
|
||||||
|
],
|
||||||
|
$docblock->getTags()
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user