PeriodServiceFactoryTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 1
cbo 2
dl 0
loc 24
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testFactoryProcessesWithoutErrors() 0 21 1
1
<?php
2
3
namespace JhFlexiTimeTest\Service\Factory;
4
5
use JhFlexiTime\Service\Factory\PeriodServiceFactory;
6
7
/**
8
 * Class PeriodServiceFactoryTest
9
 * @package JhFlexiTimeTest\Service\Factory
10
 * @author Aydin Hassan <[email protected]>
11
 */
12
class PeriodServiceFactoryTest extends \PHPUnit_Framework_TestCase
13
{
14
    public function testFactoryProcessesWithoutErrors()
15
    {
16
        $serviceLocator   = $this->getMock('Zend\ServiceManager\ServiceLocatorInterface');
17
        $services         = [
18
            'FlexiOptions' => $this->getMock('JhFlexiTime\Options\ModuleOptions'),
19
        ];
20
21
        $serviceLocator
22
            ->expects($this->any())
23
            ->method('get')
24
            ->will(
25
                $this->returnCallback(
26
                    function ($serviceName) use ($services) {
27
                        return $services[$serviceName];
28
                    }
29
                )
30
            );
31
32
        $factory = new PeriodServiceFactory();
33
        $this->assertInstanceOf('JhFlexiTime\Service\PeriodService', $factory->createService($serviceLocator));
34
    }
35
}
36