Completed
Push — master ( 0141b8...171c3a )
by Ivannis Suárez
04:55
created

VersionStoreTestCase   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 34
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
createStore() 0 1 ?
A testPersist() 0 10 1
A testLoad() 0 9 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\Domain\EventSourcing\Tests\Units\Versioning;
13
14
use Cubiche\Domain\EventSourcing\Tests\Fixtures\PostEventSourced;
15
use Cubiche\Domain\EventSourcing\Tests\Units\TestCase;
16
use Cubiche\Domain\EventSourcing\Versioning\VersionStoreInterface;
17
18
/**
19
 * VersionStoreTestCase class.
20
 *
21
 * Generated by TestGenerator on 2016-07-29 at 12:24:22.
22
 */
23
abstract class VersionStoreTestCase extends TestCase
24
{
25
    /**
26
     * @return VersionStoreInterface
27
     */
28
    abstract protected function createStore();
29
30
    /**
31
     * Test persist method.
32
     */
33
    public function testPersist()
34
    {
35
        $this
36
            ->given($store = $this->createStore())
37
            ->when($store->persist(PostEventSourced::class, 10))
38
            ->then()
39
                ->integer($store->load(PostEventSourced::class))
40
                    ->isEqualTo(10)
41
        ;
42
    }
43
44
    /**
45
     * Test load method.
46
     */
47
    public function testLoad()
48
    {
49
        $this
50
            ->given($store = $this->createStore())
51
            ->then()
52
                ->integer($store->load(PostEventSourced::class))
53
                    ->isEqualTo(0)
54
        ;
55
    }
56
}
57