UseCaseAddedSpec   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
lcom 0
cbo 3
dl 0
loc 25
rs 10
c 1
b 0
f 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 6 1
A it_is_initializable() 0 5 1
A it_should_contain_payload_as_array() 0 4 1
A it_should_contain_model_id() 0 4 1
1
<?php
2
3
namespace spec\Hexarchium\CoreDomain\Model\Domain\Events;
4
5
use Hexarchium\CoreDomain\Events\DomainEventInterface;
6
use Hexarchium\CoreDomain\Model\Domain\Entity\UseCase;
7
use Hexarchium\CoreDomain\Model\Domain\Events\UseCaseAdded;
8
use Hexarchium\CoreDomain\Model\Domain\UseCase\UseCaseId;
9
use PhpSpec\ObjectBehavior;
10
11
class UseCaseAddedSpec extends ObjectBehavior
12
{
13
    function let(UseCase $useCase)
14
    {
15
        $useCaseId = new UseCaseId('UseCaseId');
16
        $useCase->getId()->willReturn($useCaseId);
17
        $this->beConstructedWith(new \DateTime(), $useCase);
18
    }
19
20
    function it_is_initializable()
21
    {
22
        $this->shouldHaveType(UseCaseAdded::class);
23
        $this->shouldBeAnInstanceOf(DomainEventInterface::class);
24
    }
25
26
    function it_should_contain_payload_as_array()
27
    {
28
        $this->getPayload()->shouldBeArray();
29
    }
30
31
    function it_should_contain_model_id()
32
    {
33
        $this->getPayload()->shouldHaveKeyWithValue('use_case.id', 'UseCaseId');
34
    }
35
}
36