FactoryTest::setUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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