/** * @param int $userId * @return int * @throws UserDoesNotExistException */ public function execute($userId) { $user = $this->userRepository->userOfId(new UserId($userId)); if (null === $user) { throw new UserDoesNotExistException(); } return $user->grantWishes(); }
/** * @test */ public function afterUserSignUpItShouldBeInTheRepository() { $user = $this->executeSignIn(); $this->assertSame($user, $this->userRepository->userOfId($user->id())); }