function it_does_not_register_because_the_user_is_already_exists(SignInUserRequest $request, UserEmail $email, UserRepository $repository, User $user)
 {
     $request->email()->shouldBeCalled()->willReturn($email);
     $request->password()->shouldBeCalled()->willReturn('password');
     $repository->userOfEmail($email)->shouldBeCalled()->willReturn($user);
     $this->shouldThrow(new UserAlreadyExistsException())->during('execute', [$request]);
 }
Ejemplo n.º 2
0
 /**
  * getUser
  *
  * @param integer $id
  * @return User
  */
 public function getUser($id)
 {
     return $this->userRepository->findOneBy(['id' => $id]);
 }