InMemoryStorageTests   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 23
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testCreate() 0 9 1
A createStorage() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of the Cubiche package.
5
 *
6
 * Copyright (c) Cubiche
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Cubiche\Core\Storage\Tests\Units;
13
14
use Cubiche\Core\Serializer\DefaultSerializer;
15
use Cubiche\Core\Storage\InMemoryStorage;
16
use Cubiche\Core\Storage\StorageInterface;
17
18
/**
19
 * InMemoryStorageTests class.
20
 *
21
 * @author Ivannis Suárez Jerez <[email protected]>
22
 */
23
class InMemoryStorageTests extends StorageTestCase
24
{
25
    /**
26
     * Test get method.
27
     */
28
    public function testCreate()
29
    {
30
        $this
31
            ->given($storage = new InMemoryStorage(new DefaultSerializer(), array('foo' => 'bar')))
32
            ->then()
33
                ->string($storage->get('foo'))
34
                    ->isEqualTo('bar')
35
        ;
36
    }
37
38
    /**
39
     * @return StorageInterface
40
     */
41
    protected function createStorage()
42
    {
43
        return new InMemoryStorage(new DefaultSerializer());
44
    }
45
}
46