| 1 | <?php |
||
| 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 | } |
||
| 47 |