Passed
Push — master ( 579a8b...9acb0f )
by Oss
01:46
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
rs 10
c 0
b 0
f 0

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
use Brownie\Util\StorageList;
4
5
class StorageListTest extends PHPUnit_Framework_TestCase
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
6
{
7
8
    /**
9
     * @var StorageList
10
     */
11
    private $storageList;
12
13
    protected function setUp()
14
    {
15
        $this->storageList = new StorageList(array(
16
            'test1' => 'Hello1',
17
            'test3' => 'Hello3',
18
            'test4' => 'Hello4',
19
        ));
20
    }
21
22
    protected function tearDown()
23
    {
24
        $this->storageList = null;
25
    }
26
27
    public function testGet()
28
    {
29
        $this->assertEquals('Hello1', $this->storageList->get('test1'));
30
        $this->assertEquals('Hello3', $this->storageList->get('test3'));
31
        $this->assertEquals('Hello4', $this->storageList->get('test4'));
32
        $this->assertNull($this->storageList->get('test5'));
33
    }
34
35
    public function testToArray()
36
    {
37
        $list = array(
38
            'test1' => 'Hello1',
39
            'test3' => 'Hello3',
40
            'test4' => 'Hello4',
41
        );
42
        $this->assertEquals($list, $this->storageList->toArray());
43
    }
44
}
45