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

UseCaseTest::testInitialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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