Completed
Push — master ( 7a3efc...f79493 )
by Al3x
02:58
created

ProductManagerFactoryTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 4
dl 0
loc 15
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testCreate() 0 12 1
1
<?php
2
declare(strict_types=1);
3
4
namespace InvoiceNinjaModuleTest\Service;
5
6
use Interop\Container\ContainerInterface;
7
use InvoiceNinjaModule\Service\Interfaces\ObjectServiceInterface;
8
use InvoiceNinjaModule\Service\Interfaces\ProductManagerInterface;
9
use InvoiceNinjaModule\Service\InvoiceManager;
10
use InvoiceNinjaModule\Service\InvoiceManagerFactory;
11
use InvoiceNinjaModule\Service\ObjectService;
12
use InvoiceNinjaModule\Service\ProductManagerFactory;
13
use PHPUnit\Framework\TestCase;
14
15
class ProductManagerFactoryTest extends TestCase
16
{
17
    public function testCreate() :void
18
    {
19
        $containerMock = $this->createMock(ContainerInterface::class);
20
        $containerMock->expects(self::once())
21
            ->method('get')
22
            ->with(self::stringContains(ObjectService::class))
23
            ->willReturn($this->createMock(ObjectServiceInterface::class));
24
25
        $factory = new ProductManagerFactory();
26
        $result = $factory($containerMock, 'test');
27
        self::assertInstanceOf(ProductManagerInterface::class, $result);
28
    }
29
}
30