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.

PropertyListTest::setUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace Emarref\Jwt\Token;
4
5
class PropertyListTest extends \PHPUnit_Framework_TestCase
6
{
7
    /**
8
     * @var \PHPUnit_Framework_MockObject_MockObject
9
     */
10
    private $properties;
11
12
    /**
13
     * @var PropertyListStub
14
     */
15
    private $propertyList;
16
17
    public function setUp()
18
    {
19
        $this->properties = $this->getMockBuilder('\ArrayObject')->getMock();
20
21
        $this->propertyList = new PropertyListStub($this->properties);
22
    }
23
24
    public function testSetProperty()
25
    {
26
        $property = new PropertyStub();
27
28
        $this->properties->expects($this->once())
29
            ->method('offsetSet')
30
            ->with($property->getName(), $property);
31
32
        $this->propertyList->setProperty($property);
33
34
        return $property;
35
    }
36
37
    public function testJsonSerialize()
38
    {
39
        $expectedJson = '{"one":"11","two":"2"}';
40
41
        $properties = new \ArrayIterator([
42
            new PropertyStub('one', '1'),
43
            new PropertyStub('one', '11'), // Latter takes precedence
44
            new PropertyStub('two', '2'),
45
            new PropertyStub('three', ''), // Blank value ignored
46
            new PropertyStub('', '4'),     // Blank name ignored
47
        ]);
48
49
        $this->properties->expects($this->once())
50
            ->method('getIterator')
51
            ->will($this->returnValue($properties));
52
53
        $this->assertSame($expectedJson, $this->propertyList->jsonSerialize());
54
    }
55
56
    public function testGetIterator()
57
    {
58
        $this->assertSame($this->properties, $this->propertyList->getIterator());
59
    }
60
}
61