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.

PayloadTest::testJsonSerialize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 1
eloc 6
nc 1
nop 0
1
<?php
2
3
namespace Emarref\Jwt\Token;
4
5
use Emarref\Jwt\Claim;
6
7
class PayloadTest extends \PHPUnit_Framework_TestCase
8
{
9
    /**
10
     * @var \PHPUnit_Framework_MockObject_MockObject
11
     */
12
    private $claims;
13
14
    /**
15
     * @var PayloadStub
16
     */
17
    private $payload;
18
19
    public function setUp()
20
    {
21
        $this->claims  = $this->getMockBuilder('Emarref\Jwt\Token\PropertyList')->getMock();
22
        $this->payload = new PayloadStub($this->claims);
23
    }
24
25
    public function testSetClaim()
26
    {
27
        $claim = new Claim\PrivateClaim('name', 'value');
28
29
        $this->claims->expects($this->once())
30
            ->method('setProperty')
31
            ->with($claim);
32
33
        $this->payload->setClaim($claim);
34
    }
35
36 View Code Duplication
    public function testFindClaimByName()
37
    {
38
        $claim = new Claim\PrivateClaim('name', 'value');
39
40
        $this->claims->expects($this->exactly(2))
41
            ->method('getIterator')
42
            ->will($this->returnValue(new \ArrayObject([$claim])));
43
44
        $this->assertSame($claim, $this->payload->findClaimByName('name'));
45
        $this->assertNull($this->payload->findClaimByName('none'));
46
    }
47
48
    public function testGetClaims()
49
    {
50
        $this->assertSame($this->claims, $this->payload->getClaims());
51
    }
52
53
    public function testJsonSerialize()
54
    {
55
        $expectedJson = '{"whatever":true}';
56
57
        $this->claims->expects($this->once())
58
            ->method('jsonSerialize')
59
            ->will($this->returnValue($expectedJson));
60
61
        $this->assertSame($expectedJson, $this->payload->jsonSerialize());
62
    }
63
}
64