Completed
Push — master ( ff0ae5...10958a )
by Gabriel
02:30
created

OperationsTraitTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 25
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testClear() 0 17 1
1
<?php
2
3
namespace Nip\Collections\Tests\Traits;
4
5
use Nip\Collections\Collection;
6
use Nip\Collections\Tests\AbstractTest;
7
use stdClass;
8
9
/**
10
 * Class OperationsTraitTest
11
 * @package Nip\Collections\Tests\Traits
12
 */
13
class OperationsTraitTest extends AbstractTest
14
{
15
    /**
16
     * @var Collection
17
     */
18
    protected $collection;
19
20
    public function testClear()
21
    {
22
        $this->collection = new Collection();
23
24
        static::assertEquals(0, $this->collection->count());
25
26
        $this->collection['first'] = new stdClass();
27
        static::assertEquals(1, $this->collection->count());
28
29
        $this->collection['luke'] = 'Luke Skywalker';
30
        static::assertEquals('Luke Skywalker', $this->collection['luke']);
31
32
        static::assertEquals(2, $this->collection->count());
33
34
        $this->collection->clear();
35
        static::assertEquals(0, $this->collection->count());
36
    }
37
}