SettingsControllerFactoryTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 1
cbo 3
dl 0
loc 22
rs 10

1 Method

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