Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ResetCustomerPasswordFailedTest.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Customer\Test\Page\CustomerAccountForgotPassword;
11 use Magento\Mtf\TestCase\Injectable;
12 
25 class ResetCustomerPasswordFailedTest extends Injectable
26 {
27  /* tags */
28  const MVP = 'yes';
29  const SEVERITY = 'S1';
30  /* end tags */
31 
37  protected $forgotPassword;
38 
44  protected $configData;
45 
52  public function __inject(
53  CustomerAccountForgotPassword $forgotPassword
54  ) {
55  $this->forgotPassword = $forgotPassword;
56  }
57 
65  public function test(
66  Customer $customer,
67  $attempts,
68  $configData = null
69  ) {
70  $this->configData = $configData;
71 
72  // Preconditions
73  $this->objectManager->create(
74  \Magento\Config\Test\TestStep\SetupConfigurationStep::class,
75  ['configData' => $this->configData]
76  )->run();
77 
78  // Steps
79  $customer->persist();
80  for ($i = 0; $i < $attempts; $i++) {
81  $this->forgotPassword->open();
82  $this->forgotPassword->getForgotPasswordForm()->resetForgotPassword($customer);
83  }
84  }
85 }
$customer
Definition: customers.php:11
$i
Definition: gallery.phtml:31