Passed
Push — master ( 7b7e33...6ff579 )
by Tomasz
04:38
created

UseCaseSpec   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 4 1
A it_is_initializable() 0 4 1
A it_add_domain_by_command() 0 5 1
1
<?php
2
3
namespace spec\Hexarchium\CoreDomain\UseCase\CreateDomain;
4
5
use Hexarchium\CoreDomain\Model\Domain\Repository\DomainRepositoryInterface;
6
use Hexarchium\CoreDomain\UseCase\CreateDomain\Command;
7
use Hexarchium\CoreDomain\UseCase\CreateDomain\UseCase;
8
use PhpSpec\ObjectBehavior;
9
10
class UseCaseSpec extends ObjectBehavior
11
{
12
    function let(DomainRepositoryInterface $domainRepository)
13
    {
14
        $this->beConstructedWith($domainRepository);
15
    }
16
17
    function it_is_initializable()
18
    {
19
        $this->shouldHaveType(UseCase::class);
20
    }
21
22
    function it_add_domain_by_command(Command $command)
23
    {
24
        $command->getDomainId()->shouldBeCalled();
25
        $this->handle($command)->shouldReturn(null);
26
    }
27
}
28