/**
  * @return void
  */
 public function testPerformSecurityCheck()
 {
     $requestType = \Magento\Security\Model\PasswordResetRequestEvent::CUSTOMER_PASSWORD_RESET_REQUEST;
     $accountReference = \Magento\Security\Model\Config\Source\ResetMethod::OPTION_BY_IP_AND_EMAIL;
     $longIp = 12345;
     $this->securityConfigMock->expects($this->once())->method('getRemoteIp')->will($this->returnValue($longIp));
     $this->passwordResetRequestEventFactoryMock->expects($this->once())->method('create')->willReturn($this->passwordResetRequestEventMock);
     $this->passwordResetRequestEventMock->expects($this->once())->method('setRequestType')->with($requestType)->willReturnSelf();
     $this->passwordResetRequestEventMock->expects($this->once())->method('setAccountReference')->with($accountReference)->willReturnSelf();
     $this->passwordResetRequestEventMock->expects($this->once())->method('setIp')->with($longIp)->willReturnSelf();
     $this->passwordResetRequestEventMock->expects($this->once())->method('save')->willReturnSelf();
     $this->model->performSecurityCheck($requestType, $accountReference);
 }
 /**
  * Create new password reset request record
  *
  * @param int $requestType
  * @param string|null $accountReference
  * @param int $longIp
  * @return PasswordResetRequestEvent
  */
 protected function createNewPasswordResetRequestEventRecord($requestType, $accountReference, $longIp)
 {
     /** @var \Magento\Security\Model\PasswordResetRequestEvent $passwordResetRequestEventModel */
     $passwordResetRequestEventModel = $this->passwordResetRequestEventModelFactory->create();
     $passwordResetRequestEventModel->setRequestType($requestType)->setAccountReference($accountReference)->setIp($longIp)->save();
     return $passwordResetRequestEventModel;
 }