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

InvoiceManagerFactoryTest::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
/**
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