InMemoryStorageTests::testCreate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

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