Conditions | 1 |
Paths | 1 |
Total Lines | 33 |
Code Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | public function testFactoryProcessesWithoutErrors() |
||
16 | { |
||
17 | $mockRunningBalanceService = $this->getMockBuilder('JhFlexiTime\Service\RunningBalanceService') |
||
18 | ->disableOriginalConstructor() |
||
19 | ->getMock(); |
||
20 | |||
21 | $services = [ |
||
22 | 'JhUser\Repository\UserRepository' => $this->getMock('JhUser\Repository\UserRepositoryInterface'), |
||
23 | 'JhFlexiTime\Service\RunningBalanceService' => $mockRunningBalanceService, |
||
24 | 'Console' => $this->getMock('Zend\Console\Adapter\AdapterInterface') |
||
25 | ]; |
||
26 | |||
27 | $serviceLocator = $this->getMock('Zend\ServiceManager\ServiceLocatorInterface'); |
||
28 | $serviceLocator |
||
29 | ->expects($this->any()) |
||
30 | ->method('get') |
||
31 | ->will( |
||
32 | $this->returnCallback( |
||
33 | function ($serviceName) use ($services) { |
||
34 | return $services[$serviceName]; |
||
35 | } |
||
36 | ) |
||
37 | ); |
||
38 | |||
39 | $controllerPluginManager = new PluginManager(); |
||
40 | $controllerPluginManager->setServiceLocator($serviceLocator); |
||
41 | |||
42 | $factory = new RunningBalanceCliControllerFactory(); |
||
43 | $this->assertInstanceOf( |
||
44 | 'JhFlexiTime\Controller\RunningBalanceCliController', |
||
45 | $factory->createService($controllerPluginManager) |
||
46 | ); |
||
47 | } |
||
48 | } |
||
49 |