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

ProductManagerFactoryTest::testCreate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

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