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

VersionStoreTestCase::testPersist()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

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