Passed
Push — master ( b2b84f...109e7c )
by Thomas Mauro
03:02
created

DoctrineDBALTransportFactoryFactoryTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 19
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace TMV\Laminas\Messenger\Test\Factory\Transport\Doctrine;
6
7
use PHPUnit\Framework\TestCase;
8
use Prophecy\PhpUnit\ProphecyTrait;
9
use Psr\Container\ContainerInterface;
10
use TMV\Laminas\Messenger\Factory\Transport\Doctrine\DoctrineDBALTransportFactoryFactory;
11
use TMV\Laminas\Messenger\Transport\Doctrine\DoctrineDBALTransportFactory;
12
use TypeError;
13
14
class DoctrineDBALTransportFactoryFactoryTest extends TestCase
15
{
16
    use ProphecyTrait;
17
18
    public function testFactory(): void
19
    {
20
        $container = $this->prophesize(ContainerInterface::class);
21
        $factory = new DoctrineDBALTransportFactoryFactory();
22
        $service = $factory($container->reveal());
23
24
        $this->assertInstanceOf(DoctrineDBALTransportFactory::class, $service);
25
    }
26
27
    public function testFactoryWithoutContainer(): void
28
    {
29
        $this->expectException(TypeError::class);
30
31
        $factory = new DoctrineDBALTransportFactoryFactory();
32
        $factory(null);
33
    }
34
}
35