NoopHandlerFactoryTest::testInvoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ArpTest\LaminasMonolog\Factory\Handler;
6
7
use Arp\LaminasFactory\FactoryInterface;
8
use Arp\LaminasMonolog\Factory\Handler\NoopHandlerFactory;
9
use Laminas\ServiceManager\Exception\ServiceNotCreatedException;
10
use Monolog\Handler\NoopHandler;
11
use PHPUnit\Framework\TestCase;
12
use Psr\Container\ContainerInterface;
13
14
/**
15
 * @covers \Arp\LaminasMonolog\Factory\Handler\NoopHandlerFactory
16
 */
17
final class NoopHandlerFactoryTest extends TestCase
18
{
19
    private ContainerInterface $container;
20
21
    public function setUp(): void
22
    {
23
        $this->container = $this->createMock(ContainerInterface::class);
24
    }
25
26
    public function testImplementsFactoryInterface(): void
27
    {
28
        $factory = new NoopHandlerFactory();
29
        $this->assertInstanceOf(FactoryInterface::class, $factory);
30
    }
31
32
    /**
33
     * @throws ServiceNotCreatedException
34
     */
35
    public function testInvoke(): void
36
    {
37
        $factory = new NoopHandlerFactory();
38
39
        $this->assertInstanceOf(NoopHandler::class, $factory($this->container, NoopHandler::class));
40
    }
41
}
42