Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SecureChangingCustomerEmailTest.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 SecureChangingCustomerEmailTest 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 
62  public function test(Customer $initialCustomer, Customer $customer)
63  {
64  // Preconditions
65  $initialCustomer->persist();
66 
67  // Steps
68  $this->objectManager->create(
69  \Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep::class,
70  ['customer' => $initialCustomer]
71  )->run();
72 
73  $this->customerAccountEdit->getAccountMenuBlock()->openMenuItem('Account Information');
74  $this->customerAccountEdit->getAccountInfoForm()->SetChangeEmail(true);
75  $this->customerAccountEdit->getAccountInfoForm()->fill($customer);
76  $this->customerAccountEdit->getAccountInfoForm()->submit();
77  }
78 
84  public function tearDown()
85  {
86  $this->objectManager->create(\Magento\Customer\Test\TestStep\LogoutCustomerOnFrontendStep::class)->run();
87  }
88 }
$customer
Definition: customers.php:11