Passed
Pull Request — master (#2)
by Alex
02:52
created

ConfigurationFactoryFactoryTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 1
b 0
f 0
dl 0
loc 22
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testIsCallable() 0 3 1
A testInvokeReturnsAConfigurationFactory() 0 9 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ArpTest\LaminasDoctrine\Factory\Service;
6
7
use Arp\LaminasDoctrine\Factory\Service\ConfigurationFactoryFactory;
8
use Arp\LaminasDoctrine\Service\Configuration\ConfigurationFactory;
9
use Laminas\ServiceManager\ServiceLocatorInterface;
10
use PHPUnit\Framework\MockObject\MockObject;
11
use PHPUnit\Framework\TestCase;
12
13
/**
14
 * @covers \Arp\LaminasDoctrine\Factory\Service\ConfigurationFactoryFactory
15
 *
16
 * @author  Alex Patterson <[email protected]>
17
 * @package ArpTest\LaminasDoctrine\Factory\Service
18
 */
19
final class ConfigurationFactoryFactoryTest extends TestCase
20
{
21
    /**
22
     * Assert the factory defines an __invoke() method
23
     */
24
    public function testIsCallable(): void
25
    {
26
        $this->assertIsCallable(new ConfigurationFactoryFactory());
27
    }
28
29
    /**
30
     * Assert that the __invoke() method will create a new ConfigurationFactory instance
31
     */
32
    public function testInvokeReturnsAConfigurationFactory(): void
33
    {
34
        $factory = new ConfigurationFactoryFactory();
35
36
        /** @var ServiceLocatorInterface&MockObject $container */
37
        $container = $this->createMock(ServiceLocatorInterface::class);
38
39
        /** @noinspection UnnecessaryAssertionInspection */
40
        $this->assertInstanceOf(ConfigurationFactory::class, $factory($container, ConfigurationFactory::class));
41
    }
42
}
43