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 — develop ( 3775f1...a1ecb7 )
by Sébastien
02:32
created

AddCollectionTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 67
rs 10
c 0
b 0
f 0
wmc 1
lcom 1
cbo 3
1
<?php
2
/**
3
 * Novactive Collection.
4
 *
5
 * @author    Luke Visinoni <[email protected], [email protected]>
6
 * @author    Sébastien Morel <[email protected], [email protected]>
7
 * @copyright 2017 Novactive
8
 * @license   MIT
9
 */
10
11
namespace Novactive\Tests;
12
13
use Novactive\Collection\Factory;
14
15
/**
16
 * Class AddCollectionTest.
17
 */
18
class AddCollectionTest extends UnitTestCase
19
{
20
    public function testAddAppendsItemToCollectionWithNextNumericIndex()
21
    {
22
        $array = Factory::create($this->fixtures['array']);
23
        $this->assertEquals(
24
            [
25
                0 => 'first',
26
                1 => 'second',
27
                2 => 'third',
28
            ],
29
            $array->toArray()
30
        );
31
        $array->add('fourth');
32
        $this->assertSame(
33
            [
34
                0 => 'first',
35
                1 => 'second',
36
                2 => 'third',
37
                3 => 'fourth',
38
            ],
39
            $array->toArray()
40
        );
41
        $array->add('fifth');
42
        $this->assertSame(
43
            [
44
                0 => 'first',
45
                1 => 'second',
46
                2 => 'third',
47
                3 => 'fourth',
48
                4 => 'fifth',
49
            ],
50
            $array->toArray()
51
        );
52
53
        $assoc = Factory::create($this->fixtures['assoc']);
54
        $this->assertEquals(
55
            [
56
                '1st' => 'first',
57
                '2nd' => 'second',
58
                '3rd' => 'third',
59
            ],
60
            $assoc->toArray()
61
        );
62
        $assoc->add('fourth');
63
        $this->assertSame(
64
            [
65
                '1st' => 'first',
66
                '2nd' => 'second',
67
                '3rd' => 'third',
68
                0     => 'fourth',
69
            ],
70
            $assoc->toArray()
71
        );
72
        $assoc->add('fifth');
73
        $this->assertSame(
74
            [
75
                '1st' => 'first',
76
                '2nd' => 'second',
77
                '3rd' => 'third',
78
                0     => 'fourth',
79
                1     => 'fifth',
80
            ],
81
            $assoc->toArray()
82
        );
83
    }
84
}
85