Completed
Push — master ( 578058...a989ed )
by Alex
31s queued 12s
created

NoopHandlerFactoryTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 7
c 1
b 0
f 0
dl 0
loc 23
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testInvoke() 0 5 1
A testImplementsFactoryInterface() 0 4 1
A setUp() 0 3 1
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