Completed
Push — master ( 1fe5d2...6a0fd3 )
by Tomasz
02:28
created

UseCaseSpec::it_is_initializable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace spec\Hexarchium\CoreDomain\UseCase\CreateUseCase;
4
5
use Hexarchium\CoreDomain\Model\Domain\DomainId;
6
use Hexarchium\CoreDomain\Model\Domain\Repository\DomainRepositoryInterface;
7
use Hexarchium\CoreDomain\UseCase\CreateUseCase\Command;
8
use Hexarchium\CoreDomain\UseCase\CreateUseCase\UseCase;
9
use PhpSpec\ObjectBehavior;
10
use Prophecy\Argument;
11
12 View Code Duplication
class UseCaseSpec extends ObjectBehavior
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
13
{
14
    function let(DomainRepositoryInterface $domainRepository)
15
    {
16
        $this->beConstructedWith($domainRepository);
17
    }
18
19
    function it_is_initializable()
20
    {
21
        $this->shouldHaveType(UseCase::class);
22
    }
23
24
    function it_should_have_handle_method_for_command(DomainRepositoryInterface $domainRepository, Command $command)
25
    {
26
        /** @var DomainId $domainId */
27
        $domainId = Argument::type(DomainId::class);
28
        $domainRepository->getById($domainId)->shouldBeCalled();
29
30
        $command->getDomainId()->shouldBeCalled();
31
        $command->getUseCaseId()->shouldBeCalled();
32
        $command->getUseCaseType()->willReturn('command');
33
34
        $this->handle($command)->shouldReturn(null);
35
    }
36
}
37