/** * @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); }
public function changePassword(UuidInterface $userId, $password) { $user = $this->userRepository->findOneById($userId); $userPasswordValidator = new UserPasswordValidator(); $userPasswordValidator->assertPasswordValid($user, $password); $user->setPassword($password); $this->update($user); }
public function testFindOneByIdThrowsException() { $this->setExpectedException(EntityNotFoundException::class, 'User not found'); $this->userRepository->findOneById($this->dummyData->getId()); }