Exemplo n.º 1
0
 public function testVerifyRegistrationPersistsVerifiedUserAndDeletesToken()
 {
     $captured = $this->expectingPersistedUserEntity();
     $user = $this->withExistingUser();
     $userToken = new TokenEntity();
     $userToken->exchangeArray(['id' => '1', 'token_type_id' => TokenEntity::TYPE_VERIFY_REGISTRATION, 'expires' => time() + 1000, 'user_id' => $user->getId()]);
     $this->expectingDeletedToken($userToken);
     $returnValue = $this->userService->verifyRegistration($userToken);
     $this->assertTrue($captured->persistedUserEntity->getVerified());
     $this->assertSame($user, $returnValue);
 }
Exemplo n.º 2
0
 public function userId()
 {
     return $this->userToken->getUserId();
 }
Exemplo n.º 3
0
 /**
  * @todo Change this URL to a route in the javascript app that will perform
  *       the API request since the API expects the token as a POST parameter
  *
  * @return string
  */
 public function url()
 {
     $parameters = ['id' => $this->userToken->getUserId(), 'token' => $this->userToken->getToken()];
     $url = $this->urlGenerator->generate('reset-password', $parameters, UrlGenerator::ABSOLUTE_URL);
     return $url;
 }