/**
  * Delete operator account
  *
  * @param string $id Login name of account to delete
  * @throws \RuntimeException if the account to delete is logged in for the current session
  */
 public function delete($id)
 {
     if ($id == $this->_authenticationService->getIdentity()) {
         throw new \RuntimeException('Cannot delete account of current user');
     }
     $this->_operators->delete(array('id' => $id));
 }
 public function testLogoutAction()
 {
     $this->_mockAuthenticationService(true);
     $this->_authenticationService->expects($this->once())->method('clearIdentity');
     $this->dispatch('/console/login/logout');
     $this->assertRedirectTo('/console/login/login/');
 }
Example #3
0
 /**
  * Log out and get back to login form
  *
  * @return \Zend\Http\Response Redirect response
  */
 public function logoutAction()
 {
     $this->_authenticationService->clearIdentity();
     return $this->redirectToRoute('login', 'login');
 }
 public function testChangeIdentityNoIdentity()
 {
     $this->setExpectedException('InvalidArgumentException', 'No identity provided');
     $this->_auth->changeIdentity('');
 }