Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SecureChangingCustomerPasswordTest.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\TestCase\Injectable;
11 use Magento\Customer\Test\Page\CustomerAccountEdit;
12 
29 class SecureChangingCustomerPasswordTest extends Injectable
30 {
31  /* tags */
32  const MVP = 'yes';
33  const SEVERITY = 'S1';
34  /* end tags */
35 
42 
49  public function __inject(
50  CustomerAccountEdit $customerAccountEdit
51  ) {
52  $this->customerAccountEdit = $customerAccountEdit;
53  }
54 
63  public function test(Customer $initialCustomer, Customer $customer, $check)
64  {
65  // Preconditions
66  $initialCustomer->persist();
67 
68  // Steps
69  $this->objectManager->create(
70  \Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep::class,
71  ['customer' => $initialCustomer]
72  )->run();
73 
74  $this->customerAccountEdit->getAccountMenuBlock()->openMenuItem('Account Information');
75  if ($check) {
76  $this->customerAccountEdit->getAccountInfoForm()->SetChangePassword(true);
77  $this->customerAccountEdit->getAccountInfoForm()->fill($customer);
78  $this->customerAccountEdit->getAccountInfoForm()->submit();
79  }
80  }
81 
87  public function tearDown()
88  {
89  $this->objectManager->create(\Magento\Customer\Test\TestStep\LogoutCustomerOnFrontendStep::class)->run();
90  }
91 }
$customer
Definition: customers.php:11