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
Pull Request — master (#11)
by Sébastien
04:15 queued 01:30
created

FilterCollectionTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 29
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\Collection;
14
use Novactive\Collection\Factory;
15
16
/**
17
 * Class FilterCollectionTest.
18
 */
19
class FilterCollectionTest extends UnitTestCase
20
{
21
    public function testFilterReturnsNewCollectionFilteredByPredicateCallback()
22
    {
23
        $predicate = function ($val, $key) {
24
            return strlen($val) > 4;
25
        };
26
27
        $coll = Factory::create($this->fixtures['names']);
28
29
        $this->assertCount(10, $coll);
30
        $filtered = $coll->filter($predicate);
31
        $this->assertInstanceOf(Collection::class, $filtered);
32
        $this->assertNotSame($coll, $filtered);
33
        $this->assertCount(10, $coll);
34
        $this->assertCount(6, $filtered);
35
        $this->assertEquals(
36
            [
37
                0 => 'Chelsea',
38
                1 => 'Adella',
39
                2 => 'Monte',
40
                4 => 'Lottie',
41
                6 => 'Dayton',
42
                9 => 'Nakia',
43
            ],
44
            $filtered->toArray()
45
        );
46
    }
47
}
48