ServiceFactoryTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

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

1 Method

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