Passed
Push — master ( 579a8b...9acb0f )
by Oss
01:46
created

StorageListTest::testGet()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
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