ModelSpec   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 23
rs 10
c 0
b 0
f 0

4 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
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\Model;
8
use Hexarchium\CoreDomain\Model\Domain\Model\ModelId;
9
use PhpSpec\ObjectBehavior;
10
11
class ModelSpec extends ObjectBehavior
12
{
13
    function let(ModelId $modelId)
14
    {
15
        $this->beConstructedWith($modelId);
16
    }
17
18
    function it_is_initializable()
19
    {
20
        $this->shouldHaveType(Model::class);
21
        $this->shouldNotBeAnInstanceOf(AggregateRootInterface::class);
22
    }
23
24
    function it_should_return_id_by_getter()
25
    {
26
        $this->getId()->shouldReturnAnInstanceOf(ModelId::class);
27
    }
28
29
    function it_should_allow_assign_domain(Domain $domain)
30
    {
31
        $this->setDomain($domain)->shouldReturn(null);
32
    }
33
}
34