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

ContainsCollectionTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 27
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 ContainsCollectionTest.
17
 */
18
class ContainsCollectionTest extends UnitTestCase
19
{
20
    public function testContainsReturnsTrueIfValueFoundInCollection()
21
    {
22
        $coll = Factory::create($this->fixtures['assoc']);
23
        $this->assertTrue($coll->contains('first'));
24
        $this->assertTrue($coll->contains('second'));
25
        $this->assertTrue($coll->contains('third'));
26
        $this->assertFalse($coll->contains('fourth'));
27
        $this->assertFalse($coll->contains('foo'));
28
        $coll->add('foo');
29
        $this->assertTrue($coll->contains('foo'));
30
31
        $this->assertFalse($coll->contains(100));
32
        $coll->add(100);
33
        $this->assertFalse(
34
            $coll->contains('100'),
35
            'Collection::contains method uses strict type comparison so that 100 !== "100"'
36
        );
37
        // @todo
38
        //      I think we should add a second argument to contains() that does an additional check against
39
        //      the index so taht you can check whether the collection contains a certain value at a certain index.
40
        //      I think we should also allow for $value argument to be a callable. When it is a callable,
41
        //      it should be used instead of in_array to determine whether the collection contains whatever...
42
        $this->assertTrue($coll->contains(100));
43
    }
44
}
45