public function testInvalidateTokens() { $token = $this->service->generateToken($this->user, 'action'); $this->service->invalidateTokens($this->user, 'action'); $this->assertFalse($this->service->checkToken($this->user, $token, 'action')); }
/** * Send password restore token * * @param Newscoop\Entity\User $user * @return void */ public function sendPasswordRestoreToken(User $user) { $message = $this->view->action('password-restore', 'email', 'default', array('user' => $user->getId(), 'token' => $this->tokenService->generateToken($user, 'password.restore'), 'format' => null)); $this->send($this->view->placeholder(self::PLACEHOLDER_SUBJECT), $message, $user->getEmail()); }