Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CreateExistingCustomerBackendEntity.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\TestCase\Injectable;
11 use Magento\Customer\Test\Page\Adminhtml\CustomerIndex;
12 use Magento\Customer\Test\Page\Adminhtml\CustomerIndexNew;
13 
28 class CreateExistingCustomerBackendEntity extends Injectable
29 {
30  /* tags */
31  const MVP = 'yes';
32  /* end tags */
33 
39  protected $pageCustomerIndex;
40 
47 
55  public function __inject(
56  CustomerIndex $pageCustomerIndex,
57  CustomerIndexNew $pageCustomerIndexNew
58  ) {
59  $this->pageCustomerIndex = $pageCustomerIndex;
60  $this->pageCustomerIndexNew = $pageCustomerIndexNew;
61  }
62 
69  public function test(Customer $customer)
70  {
71  // Precondition
72  $customer->persist();
73 
74  // Steps
75  $this->pageCustomerIndex->open();
76  $this->pageCustomerIndex->getPageActionsBlock()->addNew();
77  $this->pageCustomerIndexNew->getCustomerForm()->fillCustomer($customer);
78  $this->pageCustomerIndexNew->getPageActionsBlock()->save();
79  }
80 }
$customer
Definition: customers.php:11
__inject(CustomerIndex $pageCustomerIndex, CustomerIndexNew $pageCustomerIndexNew)