/** * Get user for given id * * @return Newscoop\Entity\User */ protected function getUser() { $id = $this->_getParam('user', false); if (!$id) { $this->_helper->flashMessenger(array('error', getGS('User id not specified'))); $this->_helper->redirector('index'); } $user = $this->userService->find($id); if (empty($user)) { $this->_helper->flashMessenger(array('error', getGS("User with id '\$1' not found", $id))); $this->_helper->redirector('index'); } return $user; }
/** * Get user for given id * * @return Newscoop\Entity\User */ protected function getUser() { $translator = \Zend_Registry::get('container')->getService('translator'); $id = (int) $this->_getParam('user', false); if (!$id) { $this->_helper->flashMessenger(array('error', $translator->trans('User id not specified', array(), 'users'))); $this->_helper->redirector('index'); } $user = $this->userService->find($id); if (empty($user)) { $this->_helper->flashMessenger(array('error', $translator->trans("User with id \$1 not found", array('$1' => $id), 'users'))); $this->_helper->redirector('index'); } return $user; }
public function testDeletePending() { $user = $this->service->createPending('*****@*****.**'); $this->service->delete($user); $this->assertEmpty($this->service->find($user->getId())); }