PostRemoveEventTests::testAggregate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 10

Duplication

Lines 15
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 15
loc 15
rs 9.4285
c 1
b 0
f 1
cc 1
eloc 10
nc 1
nop 0
1
<?php
2
3
/**
4
 * This file is part of the Cubiche/EventSourcing component.
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
namespace Cubiche\Domain\EventSourcing\Tests\Units\Event;
12
13
use Cubiche\Domain\EventSourcing\Event\PostRemoveEvent;
14
use Cubiche\Domain\EventSourcing\Tests\Fixtures\PostEventSourcedFactory;
15
use Cubiche\Domain\EventSourcing\Tests\Units\TestCase;
16
17
/**
18
 * PostRemoveEventTests class.
19
 *
20
 * Generated by TestGenerator on 2016-10-04 at 15:35:22.
21
 */
22 View Code Duplication
class PostRemoveEventTests extends TestCase
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
23
{
24
    /**
25
     * Test Aggregate method.
26
     */
27
    public function testAggregate()
28
    {
29
        $this
30
            ->given(
31
                $post = PostEventSourcedFactory::create(
32
                    $this->faker->sentence,
33
                    $this->faker->paragraph
34
                )
35
            )
36
            ->and($event = new PostRemoveEvent($post))
37
            ->then()
38
                ->object($event->aggregate())
39
                    ->isEqualTo($post)
40
        ;
41
    }
42
}
43