/**
  * Create customer.
  *
  * @param Customer $customer
  * @param CustomerAccountForgotPassword $forgotPassword
  * @return void
  */
 public function test(Customer $customer, CustomerAccountForgotPassword $forgotPassword)
 {
     // Precondition
     $customer->persist();
     // Steps
     $forgotPassword->open();
     $forgotPassword->getForgotPasswordForm()->resetForgotPassword($customer);
 }
 /**
  * Run reset customer password failed test.
  * @param Customer $customer
  * @param int $attempts
  * @return void
  */
 public function test(Customer $customer, $attempts)
 {
     // Steps
     $customer->persist();
     for ($i = 0; $i < $attempts; $i++) {
         $this->forgotPassword->open();
         $this->forgotPassword->getForgotPasswordForm()->resetForgotPassword($customer);
     }
 }
 /**
  * Assert that customer forgot password message is present on customer account forgot password page.
  *
  * @param CustomerAccountForgotPassword $customerForgotPassword
  * @return void
  */
 public function processAssert(CustomerAccountForgotPassword $customerForgotPassword)
 {
     \PHPUnit_Framework_Assert::assertEquals(self::TOO_MANY_RESET_REQUESTS_MESSAGE, $customerForgotPassword->getMessagesBlock()->getErrorMessage(), 'Wrong customer reset password failed message is displayed.');
 }