public function testCreateUser()
 {
     $this->_service->create($this->_user);
     $this->assertNotNull($this->_user->getId());
     $lastUsedPasswords = $this->_service->getLastUsedPasswords($this->_user->getId());
     $this->assertNotEmpty($lastUsedPasswords);
 }
 public function postAction()
 {
     $data = $this->_helper->requestData(true);
     $user = new UserModel($this->_mapToModel($data));
     $this->_validateUserData($user);
     $this->_helper->allowed('create', $user);
     $this->_userSrv->create($user);
     $this->getResponse()->setHttpResponseCode(201);
 }
 /**
  * Create a new user
  */
 public function postAction()
 {
     // Filter data
     $data = $this->_helper->requestData(true);
     $data = $this->_helper->filter($data)->blacklist(array('id', 'password', 'status'));
     $user = new UserModel($data);
     // Check if it's allowed
     $this->_helper->allowed('create', $user);
     $this->_userSrv->create($user);
     // Response with the user id
     $this->view->data = $user->getId();
 }