Completed
Push — master ( 08c0b3...86733d )
by Jaap
39s queued 36s
created

DocblockSeeTagResolvingTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 28
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testResolvesSeeFQSENOfInlineTags() 0 25 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace phpDocumentor\Reflection;
6
7
use phpDocumentor\Reflection\DocBlock\Tags\See;
8
use phpDocumentor\Reflection\Types\Context;
9
use PHPUnit\Framework\TestCase;
10
11
class DocblockSeeTagResolvingTest extends TestCase
12
{
13
    public function testResolvesSeeFQSENOfInlineTags()
14
    {
15
        $context = new Context('\Project\Sub\Level', ['Issue2425B' => '\Project\Other\Level\Issue2425B', 'Aliased' => 'Project\Other\Level\Issue2425C']);
16
        $docblockString = <<<DOCBLOCK
17
/**
18
 * Class summary.
19
 *
20
 * A description containing an inline {@see Issue2425B::bar()} tag
21
 * to a class inside of the project referenced via a use statement.
22
 *
23
 * And here is another inline {@see Aliased::bar()} tag to a class
24
 * aliased via a use statement.
25
 */
26
DOCBLOCK;
27
28
29
30
        $factory  = DocBlockFactory::createInstance();
31
        $docblock = $factory->create($docblockString, $context);
32
33
        /** @var See $see1 */
34
        $see1 = $docblock->getDescription()->getTags()[0];
35
36
        $this->assertSame('\Project\Other\Level\Issue2425B::bar()', (string)$see1->getReference());
37
    }
38
}
39