public function testCreateByIdThrowsExceptionWhenInvalid() { $this->setExpectedException(InvalidArgumentException::class); UserLoginResultType::createById(999); }
/** * @param string $email * @param string $remoteIp * @return User * @throws UserLoginException */ private function getUserOrAssertAndRecordLoginFailure($email, $remoteIp) { try { $user = $this->userRepository->findOneByEmail($email); } catch (EntityNotFoundException $e) { $this->recordLogin($email, $remoteIp, UserLoginResultType::fail()); throw UserLoginException::userNotFound(); } if (!$user->getStatus()->isActive()) { $this->recordLogin($email, $remoteIp, UserLoginResultType::fail()); throw UserLoginException::userNotActive(); } return $user; }
public function getUserLoginResultType() { return UserLoginResultType::success(); }
protected function preBuild() { $this->entityDTO->isFail = $this->entity->isFail(); $this->entityDTO->isSuccess = $this->entity->isSuccess(); }