GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — 4.2-to-master ( ed215f )
by E
06:47
created

TraitsTest   A

Complexity

Total Complexity 12

Size/Duplication

Total Lines 76
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 76
rs 10
c 0
b 0
f 0
wmc 12
lcom 1
cbo 2

12 Methods

Rating   Name   Duplication   Size   Complexity  
A testIsTrait() 0 4 1
A testGetTraits() 0 7 1
A testGetOwnTraits() 0 5 1
A testGetTraitNames() 0 7 1
A testGetOwnTraitName() 0 7 1
A testGetTraitAliases() 0 4 1
A testGetTraitProperties() 0 4 1
A testGetTraitMethods() 0 4 1
A testUsesTrait() 0 5 1
A testUsesTraitNotExisting() 0 4 1
A testGetDirectUsers() 0 4 1
A testGetIndirectUsers() 0 4 1
1
<?php declare(strict_types=1);
2
3
namespace ApiGen\Parser\Tests\Reflections\ReflectionClass;
4
5
use ApiGen\Contracts\Parser\Reflection\ClassReflectionInterface;
6
use ApiGen\Parser\Tests\Reflection\ReflectionClass\AbstractReflectionClassTestCase;
7
8
final class TraitsTest extends AbstractReflectionClassTestCase
9
{
10
    public function testIsTrait(): void
11
    {
12
        $this->assertFalse($this->reflectionClass->isTrait());
13
    }
14
15
    public function testGetTraits(): void
16
    {
17
        $traits = $this->reflectionClass->getTraits();
18
        $this->assertCount(2, $traits);
19
        $this->assertInstanceOf(ClassReflectionInterface::class, $traits['Project\SomeTrait']);
20
        $this->assertSame('Project\SomeTraitNotPresentHere', $traits['Project\SomeTraitNotPresentHere']);
21
    }
22
23
    public function testGetOwnTraits(): void
24
    {
25
        $traits = $this->reflectionClass->getOwnTraits();
26
        $this->assertCount(2, $traits);
27
    }
28
29
    public function testGetTraitNames(): void
30
    {
31
        $this->assertSame(
32
            ['Project\SomeTrait', 'Project\SomeTraitNotPresentHere'],
33
            $this->reflectionClass->getTraitNames()
34
        );
35
    }
36
37
    public function testGetOwnTraitName(): void
38
    {
39
        $this->assertSame(
40
            ['Project\SomeTrait', 'Project\SomeTraitNotPresentHere'],
41
            $this->reflectionClass->getOwnTraitNames()
42
        );
43
    }
44
45
    public function testGetTraitAliases(): void
46
    {
47
        $this->assertCount(0, $this->reflectionClass->getTraitAliases());
48
    }//
49
50
    public function testGetTraitProperties(): void
51
    {
52
        $this->assertCount(1, $this->reflectionClass->getTraitProperties());
53
    }
54
55
    public function testGetTraitMethods(): void
56
    {
57
        $this->assertCount(1, $this->reflectionClass->getTraitMethods());
58
    }
59
60
    public function testUsesTrait(): void
61
    {
62
        $this->assertTrue($this->reflectionClass->usesTrait('Project\SomeTrait'));
63
        $this->assertFalse($this->reflectionClass->usesTrait('Project\NotActiveTrait'));
64
    }
65
66
    /**
67
     * @expectedException \TokenReflection\Exception\RuntimeException
68
     */
69
    public function testUsesTraitNotExisting(): void
70
    {
71
        $this->reflectionClass->usesTrait('Project\SomeTraitNotPresentHere');
72
    }
73
74
    public function testGetDirectUsers(): void
75
    {
76
        $this->assertCount(1, $this->reflectionClassOfTrait->getDirectUsers());
77
    }
78
79
    public function testGetIndirectUsers(): void
80
    {
81
        $this->assertCount(0, $this->reflectionClassOfTrait->getIndirectUsers());
82
    }
83
}
84