Test Failed
Push — main ( 4e5202...c3e146 )
by Dylan
02:21
created

ServiceFactoryTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testFactory() 0 10 2
1
<?php
2
3
namespace Lifeboat\Tests\Factory;
4
5
use Lifeboat\Client;
6
use Lifeboat\Factory\ClassMap;
7
use Lifeboat\Factory\ServiceFactory;
8
use PHPUnit\Framework\TestCase;
9
10
class ServiceFactoryTest extends TestCase {
11
12
    /**
13
     * @test
14
     * @covers \Lifeboat\Factory\ServiceFactory::inst
15
     */
16
    public function testFactory()
17
    {
18
        $mock = new Client('mock', 'mock');
19
20
        foreach (ClassMap::SERVICES as $name => $class) {
21
            $this->assertInstanceOf($class, ServiceFactory::inst($mock, $name));
22
            $this->assertInstanceOf($class, ServiceFactory::inst($mock, strtoupper($name)));
23
        }
24
25
        $this->assertEquals(null, ServiceFactory::inst($mock, 'does_not_exist'));
26
    }
27
}
28