Conditions | 1 |
Paths | 1 |
Total Lines | 27 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | public function testFactoryProcessesWithoutErrors() |
||
16 | { |
||
17 | |||
18 | $services = [ |
||
19 | 'JhUser\ObjectManager' => $this->getMock('Doctrine\Common\Persistence\ObjectManager'), |
||
20 | 'JhUser\Repository\UserRepository' => $this->getMock('JhUser\Repository\UserRepositoryInterface'), |
||
21 | 'JhUser\Repository\RoleRepository' => $this->getMock('JhUser\Repository\RoleRepositoryInterface'), |
||
22 | ]; |
||
23 | |||
24 | $serviceLocator = $this->getMock('Zend\ServiceManager\ServiceLocatorInterface'); |
||
25 | $serviceLocator |
||
26 | ->expects($this->any()) |
||
27 | ->method('get') |
||
28 | ->will( |
||
29 | $this->returnCallback( |
||
30 | function ($serviceName) use ($services) { |
||
31 | return $services[$serviceName]; |
||
32 | } |
||
33 | ) |
||
34 | ); |
||
35 | |||
36 | $controllerPluginManager = new PluginManager(); |
||
37 | $controllerPluginManager->setServiceLocator($serviceLocator); |
||
38 | |||
39 | $factory = new RoleControllerFactory(); |
||
40 | $this->assertInstanceOf('JhUser\Controller\RoleController', $factory->createService($controllerPluginManager)); |
||
41 | } |
||
42 | } |
||
43 |