File: DocblockSeeTagResolvingTest.php

package info (click to toggle)
php-phpdocumentor-reflection-docblock 5.6.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,416 kB
  • sloc: php: 9,035; xml: 67; makefile: 54
file content (41 lines) | stat: -rw-r--r-- 1,125 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php

declare(strict_types=1);

namespace phpDocumentor\Reflection;

use phpDocumentor\Reflection\DocBlock\Tags\See;
use phpDocumentor\Reflection\Types\Context;
use PHPUnit\Framework\TestCase;

/**
 * @coversNothing
 */
class DocblockSeeTagResolvingTest extends TestCase
{
    public function testResolvesSeeFQSENOfInlineTags()
    {
        $context = new Context('\Project\Sub\Level', ['Issue2425B' => '\Project\Other\Level\Issue2425B', 'Aliased' => 'Project\Other\Level\Issue2425C']);
        $docblockString = <<<DOCBLOCK
/**
 * Class summary.
 *
 * A description containing an inline {@see Issue2425B::bar()} tag
 * to a class inside of the project referenced via a use statement.
 *
 * And here is another inline {@see Aliased::bar()} tag to a class
 * aliased via a use statement.
 */
DOCBLOCK;



        $factory  = DocBlockFactory::createInstance();
        $docblock = $factory->create($docblockString, $context);

        /** @var See $see1 */
        $see1 = $docblock->getDescription()->getTags()[0];

        $this->assertSame('\Project\Other\Level\Issue2425B::bar()', (string)$see1->getReference());
    }
}