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.

testCanInstantiateGivenConcreteClassName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 11
nc 1
nop 0
dl 0
loc 15
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Gandung\JWT\Tests\Proxy;
4
5
use PHPUnit\Framework\TestCase;
6
use Gandung\JWT\Proxy\AbstractProxy;
7
8
/**
9
 * @author Paulus Gandung Prakosa <[email protected]>
10
 */
11
class AbstractProxyTest extends TestCase
12
{
13
    public function testCanGetInstance()
14
    {
15
        $mock = $this->getMockBuilder(AbstractProxy::class)
16
            ->setConstructorArgs([new \ProxyManager\Factory\LazyLoadingValueHolderFactory])
17
            ->getMockForAbstractClass();
18
        $this->assertInstanceOf(AbstractProxy::class, $mock);
19
    }
20
21
    public function testCanInstantiateGivenConcreteClassName()
22
    {
23
        $mock = $this->getMockBuilder(AbstractProxy::class)
24
            ->setConstructorArgs([new \ProxyManager\Factory\LazyLoadingValueHolderFactory])
25
            ->getMockForAbstractClass();
26
        $this->assertInstanceOf(AbstractProxy::class, $mock);
27
        $caller = function () {
28
            return $this->instantiate(
0 ignored issues
show
Bug introduced by
The method instantiate() does not exist on Gandung\JWT\Tests\Proxy\AbstractProxyTest. Did you maybe mean testCanInstantiateGivenConcreteClassName()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
29
                \Gandung\JWT\Algorithm\ECDSA\ES256::class,
30
                [\Gandung\JWT\Adapter\ECDSAAdapter::create()]
31
            );
32
        };
33
        $inv = $caller->bindTo($mock, $mock);
34
        $this->assertInstanceOf(\Gandung\JWT\Algorithm\ECDSA\ES256::class, $inv());
35
    }
36
37
    /**
38
     * @expectedException \InvalidArgumentException
39
     */
40
    public function testCanRaiseExceptionWhileInstantiateNonexistClassName()
41
    {
42
        $mock = $this->getMockBuilder(AbstractProxy::class)
43
            ->setConstructorArgs([new \ProxyManager\Factory\LazyLoadingValueHolderFactory])
44
            ->getMockForAbstractClass();
45
        $this->assertInstanceOf(AbstractProxy::class, $mock);
46
        $caller = function () {
47
            return $this->instantiate(
0 ignored issues
show
Bug introduced by
The method instantiate() does not exist on Gandung\JWT\Tests\Proxy\AbstractProxyTest. Did you maybe mean testCanInstantiateGivenConcreteClassName()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
48
                'Nonexistent\Class\Name\Will\Be\Fucked\For\Good',
49
                []
50
            );
51
        };
52
        $inv = $caller->bindTo($mock, $mock);
53
        $inv();
54
    }
55
}
56