Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
All Data Structures Namespaces Files Functions Variables Pages
ResetUserPasswordFailedTest.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Backend\Test\Page\Adminhtml\SystemConfigEdit;
10 use Magento\Mtf\TestCase\Injectable;
13 
26 class ResetUserPasswordFailedTest extends Injectable
27 {
28  /* tags */
29  const MVP = 'yes';
30  const SEVERITY = 'S1';
31  /* end tags */
32 
39 
40  protected $systemConfig;
41 
47  protected $configData;
48 
54  private $systemConfigEditPage;
55 
63  public function __inject(
65  SystemConfigEdit $systemConfigEditPage
66  ) {
67  $this->userAccountForgotPassword = $userAccountForgotPassword;
68  $this->systemConfigEditPage = $systemConfigEditPage;
69  }
70 
78  public function test(
79  User $customAdmin,
80  $attempts,
81  $configData = null
82  ) {
83  $this->configData = $configData;
84 
85  // Steps
86  $customAdmin->persist();
87 
88  // Preconditions
89  $this->objectManager->create(
90  \Magento\Config\Test\TestStep\SetupConfigurationStep::class,
91  ['configData' => $this->configData]
92  )->run();
93 
94  $this->systemConfigEditPage->open();
95  $this->systemConfigEditPage->getForm()
96  ->getGroup('admin', 'captcha')->setValue('admin', 'captcha', 'enable', 'No');
97  $this->systemConfigEditPage->getPageActions()->save();
98 
99  for ($i = 0; $i < $attempts; $i++) {
100  $this->userAccountForgotPassword->open();
101  $this->userAccountForgotPassword->getForgotPasswordForm()->fill($customAdmin);
102  $this->userAccountForgotPassword->getForgotPasswordForm()->submit();
103  }
104  }
105 }
__inject(UserAccountForgotPassword $userAccountForgotPassword, SystemConfigEdit $systemConfigEditPage)
$i
Definition: gallery.phtml:31