public function testCreateService() { $serviceManager = \Mockery::mock('Zend\\ServiceManager\\ServiceManager'); $serviceManager->shouldReceive('get')->with('Config')->andReturn(array('doctrine' => array('connection' => array('connKey' => 'connValue'), 'entitymanager' => array('emKey' => 'emValue')))); $registry = $this->instance->createService($serviceManager); $this->assertInstanceOf('Doctrine\\Common\\Persistence\\AbstractManagerRegistry', $registry); }
/** * @return array */ public function getServiceConfig() { return array('factories' => array('Doctrine\\ManagerRegistry' => function ($sm) { $managerRegistryFactory = new ManagerRegistryFactory(); $managerRegistry = $managerRegistryFactory->createService($sm); return $managerRegistry; })); }