Exemplo n.º 1
0
 /**
  * @param UuidInterface $cartId
  * @param UuidInterface $userId
  * @throws EntityNotFoundException
  */
 public function setUserById(UuidInterface $cartId, UuidInterface $userId)
 {
     $user = $this->userRepository->findOneById($userId);
     $cart = $this->cartRepository->findOneById($cartId);
     $cart->setUser($user);
     $this->cartRepository->update($cart);
 }
Exemplo 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);
 }
Exemplo n.º 3
0
 public function testFindOneByIdThrowsException()
 {
     $this->setExpectedException(EntityNotFoundException::class, 'User not found');
     $this->userRepository->findOneById($this->dummyData->getId());
 }