/** * @param \Zend\ServiceManager\ServiceLocatorInterface $sl * @return \Secretary\Service\User */ public function createService(ServiceLocatorInterface $sl) { $service = new User(); /* @var \Doctrine\Orm\EntityManager $em */ $em = $sl->get('doctrine.entitymanager.orm_default'); $service->setEntityManager($em); return $service; }
protected function setUp() { parent::setUp(); $this->userService = new UserService(); $this->userService->setEntityManager($this->em); }