/**
  * Init mocks for tests
  * @return void
  */
 protected function setUp()
 {
     $this->helperMock = $this->getMock('\\Magento\\Captcha\\Helper\\Data', [], [], '', false);
     $this->actionFlagMock = $this->getMock('\\Magento\\Framework\\App\\ActionFlag', [], [], '', false);
     $this->messageManagerMock = $this->getMock('\\Magento\\Framework\\Message\\ManagerInterface', [], [], '', false);
     $this->customerSessionMock = $this->getMock('\\Magento\\Customer\\Model\\Session', ['setUsername', 'getBeforeAuthUrl'], [], '', false);
     $this->captchaStringResolverMock = $this->getMock('\\Magento\\Captcha\\Observer\\CaptchaStringResolver', [], [], '', false);
     $this->customerUrlMock = $this->getMock('\\Magento\\Customer\\Model\\Url', [], [], '', false);
     $this->customerRepositoryMock = $this->getMock('\\Magento\\Customer\\Api\\CustomerRepositoryInterface', [], [], '', false);
     $this->accountManagementHelperMock = $this->getMock('\\Magento\\Customer\\Helper\\AccountManagement', [], [], '', false);
     $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
     $this->observer = $objectManager->getObject('Magento\\Captcha\\Observer\\CheckUserLoginObserver', ['helper' => $this->helperMock, 'actionFlag' => $this->actionFlagMock, 'messageManager' => $this->messageManagerMock, 'customerSession' => $this->customerSessionMock, 'captchaStringResolver' => $this->captchaStringResolverMock, 'customerUrl' => $this->customerUrlMock]);
     $methodSetAccountManagementHelper = new \ReflectionMethod('Magento\\Captcha\\Observer\\CheckUserLoginObserver', 'setAccountManagementHelper');
     $methodSetAccountManagementHelper->setAccessible(true);
     $methodSetAccountManagementHelper->invoke($this->observer, $this->accountManagementHelperMock);
     $methodSetCustomerRepository = new \ReflectionMethod('Magento\\Captcha\\Observer\\CheckUserLoginObserver', 'setCustomerRepository');
     $methodSetCustomerRepository->setAccessible(true);
     $methodSetCustomerRepository->invoke($this->observer, $this->customerRepositoryMock);
 }