Completed
Push — master ( 116dd8...98663d )
by Al3x
02:26
created

InvoiceManagerFactoryTest   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
/**
3
 * Created by PhpStorm.
4
 * User: alex
5
 * Date: 25.04.17
6
 * Time: 22:29
7
 */
8
9
namespace InvoiceNinjaModuleTest\Service;
10
11
use Interop\Container\ContainerInterface;
12
use InvoiceNinjaModule\Service\Interfaces\ObjectServiceInterface;
13
use InvoiceNinjaModule\Service\InvoiceManager;
14
use InvoiceNinjaModule\Service\InvoiceManagerFactory;
15
use InvoiceNinjaModule\Service\ObjectService;
16
use PHPUnit\Framework\TestCase;
17
18
19
class InvoiceManagerFactoryTest extends TestCase
20
{
21
    public function testCreate()
22
    {
23
        $containerMock = $this->createMock(ContainerInterface::class);
24
        $containerMock->expects(self::once())
25
            ->method('get')
26
            ->with(self::stringContains(ObjectService::class))
27
            ->willReturn($this->createMock(ObjectServiceInterface::class));
28
29
        $factory = new InvoiceManagerFactory();
30
        $result = $factory($containerMock, 'test');
31
        self::assertInstanceOf(InvoiceManager::class, $result);
32
    }
33
}
34