public function createService(ServiceLocatorInterface $controllerManager)
 {
     $mapper = $controllerManager->getServiceLocator()->get('ScnSocialAuth-UserProviderMapper');
     $hybridAuth = $controllerManager->getServiceLocator()->get('HybridAuth');
     $moduleOptions = $controllerManager->getServiceLocator()->get('ScnSocialAuth-ModuleOptions');
     $controller = new UserController();
     $controller->setMapper($mapper);
     $controller->setHybridAuth($hybridAuth);
     $controller->setOptions($moduleOptions);
     return $controller;
 }
 public function createService(ServiceLocatorInterface $controllerManager)
 {
     $mapper = $controllerManager->getServiceLocator()->get('ScnSocialAuth-UserProviderMapper');
     $moduleOptions = $controllerManager->getServiceLocator()->get('ScnSocialAuth-ModuleOptions');
     $redirectCallback = $controllerManager->getServiceLocator()->get('zfcuser_redirect_callback');
     $controller = new UserController($redirectCallback);
     $controller->setMapper($mapper);
     $controller->setOptions($moduleOptions);
     try {
         $hybridAuth = $controllerManager->getServiceLocator()->get('HybridAuth');
         $controller->setHybridAuth($hybridAuth);
     } catch (\Zend\ServiceManager\Exception\ServiceNotCreatedException $e) {
         // This is likely the user cancelling login...
     }
     return $controller;
 }
 public function testProviderLoginInvalidProvider()
 {
     $this->controller->setOptions(new ModuleOptions());
     $result = $this->dispatch('provider-login', array('provider' => 'facebook'));
     $this->assertEquals('Page not found', $result->content);
 }