FactoryTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A testServe() 0 4 1
1
<?php
2
3
use PHPUnit\Framework\TestCase;
4
use Psr\Container\ContainerInterface;
5
use HexMakina\LeMarchand\Factory;
6
use HexMakina\LeMarchand\LeMarchand;
7
8
class FactoryTest extends TestCase
9
{
10
    private $container;
11
    private $factory;
12
13
    protected function setUp(): void
14
    {
15
        $this->container = new LeMarchand([]);
16
        $this->factory = new Factory($this->container);
17
    }
18
19
    public function testServe()
20
    {
21
        $this->expectException(HexMakina\LeMarchand\ContainerException::class);
22
        $this->assertNull($this->factory->serve('invalid'));
23
    }
24
}
25