UseCaseSpec::it_is_initializable()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 5
rs 9.4285
c 1
b 0
f 1
cc 1
eloc 3
nc 1
nop 0
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