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

ResolveTest::testNonExistingMethod()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace ApiGen\Tests\Generator\Resolvers\ElementResolver;
4
5
use ApiGen\Contracts\Parser\Reflection\ClassReflectionInterface;
6
use ApiGen\Contracts\Parser\Reflection\MethodReflectionInterface;
7
8
final class ResolveTest extends AbstractElementResolverTest
9
{
10
    public function testNonExistingMethod(): void
11
    {
12
        $classReflectionMock = $this->createMock(ClassReflectionInterface::class);
13
        $classReflectionMock->method('hasMethod')
14
            ->with('nonExistingMethod')
15
            ->willReturn(false);
16
17
        $this->assertNull($this->elementResolver->resolveElement('nonExistingMethod', $classReflectionMock));
18
    }
19
20 View Code Duplication
    public function testExistingMethod(): void
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
21
    {
22
        $classReflectionMock = $this->createMock(ClassReflectionInterface::class);
23
        $classReflectionMock->method('hasMethod')
24
            ->with('someMethod')
25
            ->willReturn(true);
26
27
        $methodReflectionMock = $this->createMock(MethodReflectionInterface::class);
28
29
        $classReflectionMock->method('getMethod')
30
            ->with('someMethod')
31
            ->willReturn($methodReflectionMock);
32
33
        $this->assertSame(
34
            $methodReflectionMock,
35
            $this->elementResolver->resolveElement('someMethod', $classReflectionMock)
36
        );
37
    }
38
39
    public function testNonExistingElement(): void
40
    {
41
        $classReflectionMock = $this->createMock(ClassReflectionInterface::class);
42
43
        $this->assertNull($this->elementResolver->resolveElement('string', $classReflectionMock));
44
    }
45
46
    public function testThis(): void
47
    {
48
        $classReflectionMock = $this->createMock(ClassReflectionInterface::class);
49
50
        $this->assertSame($classReflectionMock, $this->elementResolver->resolveElement('$this', $classReflectionMock));
51
    }
52
53
    public function testSelf(): void
54
    {
55
        $classReflectionMock = $this->createMock(ClassReflectionInterface::class);
56
57
        $this->assertSame($classReflectionMock, $this->elementResolver->resolveElement('self', $classReflectionMock));
58
    }
59
}
60