Passed
Push — master ( 6515e3...7b7e33 )
by Tomasz
03:55
created

UseCaseTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testInitialize() 0 8 1
A testHandlerWithNoException() 0 9 1
1
<?php
2
/**
3
 * Copyright
4
 */
5
namespace Hexarchium\CoreDomain\Tests\UseCase\CreateDomain;
6
7
8
use Hexarchium\CoreDomain\Model\Domain\Repository\DomainRepositoryInterface;
9
use Hexarchium\CoreDomain\UseCase\CreateDomain\Command;
10
use Hexarchium\CoreDomain\UseCase\CreateDomain\UseCase;
11
12
class UseCaseTest extends \PHPUnit_Framework_TestCase
13
{
14
    public function testInitialize()
15
    {
16
        /** @var DomainRepositoryInterface $domainRepository */
17
        $domainRepository = $this->createMock(DomainRepositoryInterface::class);
18
19
        $useCase = new UseCase($domainRepository);
20
        $this->assertInstanceOf(UseCase::class, $useCase);
21
    }
22
23
    public function testHandlerWithNoException()
24
    {
25
        /** @var DomainRepositoryInterface $domainRepository */
26
        $domainRepository = $this->createMock(DomainRepositoryInterface::class);
27
        $domainRepository->expects($this->once())->method('add');
0 ignored issues
show
Bug introduced by
The method expects() does not seem to exist on object<Hexarchium\CoreDo...ainRepositoryInterface>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
28
29
        $useCase = new UseCase($domainRepository);
30
        $useCase->handle(new Command('test'));
31
    }
32
33
34
}
35