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

ConfigurationFactoryFactoryTest::testIsCallable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
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