Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ForgotPasswordOnFrontendTest.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 use Magento\Mtf\TestStep\TestStepFactory;
13 
27 class ForgotPasswordOnFrontendTest extends Injectable
28 {
29  /* tags */
30  const MVP = 'yes';
31  /* end tags */
32 
38  private $stepFactory;
39 
45  private $configData;
46 
53  public function __inject(
54  TestStepFactory $stepFactory
55  ) {
56  $this->stepFactory = $stepFactory;
57  }
58 
67  public function test(Customer $customer, CustomerAccountForgotPassword $forgotPassword, $configData)
68  {
69  $this->configData = $configData;
70 
71  // Preconditions
72  $this->stepFactory->create(
73  \Magento\Config\Test\TestStep\SetupConfigurationStep::class,
74  ['configData' => $this->configData]
75  )->run();
76  // Precondition
77  $customer->persist();
78 
79  // Steps
80  $forgotPassword->open();
81  $forgotPassword->getForgotPasswordForm()->resetForgotPassword($customer);
82  }
83 }
$customer
Definition: customers.php:11
test(Customer $customer, CustomerAccountForgotPassword $forgotPassword, $configData)