Passed
Push — master ( d277d1...50d4cf )
by Oss
05:45
created

StorageListTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 8 1
A tearDown() 0 4 1
A testGet() 0 7 1
A testToArray() 0 9 1
1
<?php
2
3
namespace Test\Brownie\Util;
4
5
use Brownie\Util\StorageList;
6
7
class StorageListTest extends \PHPUnit_Framework_TestCase
8
{
9
10
    /**
11
     * @var StorageList
12
     */
13
    private $storageList;
14
15
    protected function setUp()
16
    {
17
        $this->storageList = new StorageList(array(
18
            'test1' => 'Hello1',
19
            'test3' => 'Hello3',
20
            'test4' => 'Hello4',
21
        ));
22
    }
23
24
    protected function tearDown()
25
    {
26
        $this->storageList = null;
27
    }
28
29
    public function testGet()
30
    {
31
        $this->assertEquals('Hello1', $this->storageList->get('test1'));
32
        $this->assertEquals('Hello3', $this->storageList->get('test3'));
33
        $this->assertEquals('Hello4', $this->storageList->get('test4'));
34
        $this->assertNull($this->storageList->get('test5'));
35
    }
36
37
    public function testToArray()
38
    {
39
        $list = array(
40
            'test1' => 'Hello1',
41
            'test3' => 'Hello3',
42
            'test4' => 'Hello4',
43
        );
44
        $this->assertEquals($list, $this->storageList->toArray());
45
    }
46
}
47