private function assertPasswordValidForUser(User $user, $passwordString, $exceptionMessage = null)
 {
     try {
         $this->userPasswordValidator->assertPasswordValid($user, $passwordString);
         $this->fail();
     } catch (UserPasswordValidationException $e) {
         $this->assertSame($exceptionMessage, $e->getMessage());
     }
 }
Esempio n. 2
0
 public function changePassword(UuidInterface $userId, $password)
 {
     $user = $this->userRepository->findOneById($userId);
     $userPasswordValidator = new UserPasswordValidator();
     $userPasswordValidator->assertPasswordValid($user, $password);
     $user->setPassword($password);
     $this->update($user);
 }
 /**
  * @param string $password
  */
 private function assertPasswordValid($password)
 {
     $user = new User();
     $userPasswordValidator = new UserPasswordValidator();
     $userPasswordValidator->assertPasswordValid($user, $password);
 }