testFactoryProcessesWithoutErrors()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 21
rs 9.3142
cc 1
eloc 13
nc 1
nop 0
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