UseCaseSpec   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 28
rs 10
c 1
b 0
f 1

5 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 4 1
A it_is_initializable() 0 5 1
A it_should_return_id_by_getter() 0 4 1
A it_should_allow_assign_domain() 0 4 1
A it_should_return_type_by_getter() 0 4 1
1
<?php
2
3
namespace spec\Hexarchium\CoreDomain\Model\Domain\Entity;
4
5
use Hexarchium\CoreDomain\Aggregate\AggregateRootInterface;
6
use Hexarchium\CoreDomain\Model\Domain\Entity\Domain;
7
use Hexarchium\CoreDomain\Model\Domain\Entity\UseCase;
8
use Hexarchium\CoreDomain\Model\Domain\UseCase\Type;
9
use Hexarchium\CoreDomain\Model\Domain\UseCase\UseCaseId;
10
use PhpSpec\ObjectBehavior;
11
12
class UseCaseSpec extends ObjectBehavior
13
{
14
    function let(UseCaseId $modelId, Type $type)
15
    {
16
        $this->beConstructedWith($modelId, $type);
17
    }
18
19
    function it_is_initializable()
20
    {
21
        $this->shouldHaveType(UseCase::class);
22
        $this->shouldNotBeAnInstanceOf(AggregateRootInterface::class);
23
    }
24
25
    function it_should_return_id_by_getter()
26
    {
27
        $this->getId()->shouldReturnAnInstanceOf(UseCaseId::class);
28
    }
29
30
    function it_should_allow_assign_domain(Domain $domain)
31
    {
32
        $this->setDomain($domain)->shouldReturn(null);
33
    }
34
35
    function it_should_return_type_by_getter()
36
    {
37
        $this->getType()->shouldBeAnInstanceOf(Type::class);
38
    }
39
}
40