ServiceFactoryTest::testFactory()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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