예제 #1
0
 public function loginmobileAction()
 {
     header('Access-Control-Allow-Origin: *');
     $this->getHelper('Layout')->disableLayout();
     $this->getHelper('ViewRenderer')->setNoRender();
     if ($this->getRequest()->isPost()) {
         $email = $this->_request->getPost('email_txt');
         $senha = $this->_request->getPost('password_txt');
         try {
             $_serviceAuth = new AuthService();
             $result = $_serviceAuth->login($email, $senha);
             $jsonData = Zend_Json::encode($result);
             $this->getResponse()->setHeader('Content-Type', 'text/json')->setBody($jsonData)->sendResponse();
             exit;
         } catch (Exception $e) {
             throw $e;
         }
     }
 }
예제 #2
0
 /**
  * @expectedException Exception
  */
 public function testLoginFunctionHasNotBeenSet()
 {
     $service = new AuthService($scope);
     $service->login([]);
 }