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 — master ( a17582...d97b9d )
by Malcolm
07:04 queued 04:10
created

PayloadTest::testJsonSerialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
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()
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...
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