Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CreateExistingCustomerFrontendEntity.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Cms\Test\Page\CmsIndex;
11 use Magento\Customer\Test\Page\CustomerAccountCreate;
13 use Magento\Mtf\TestCase\Injectable;
14 
29 class CreateExistingCustomerFrontendEntity extends Injectable
30 {
31  /* tags */
32  const MVP = 'yes';
33  /* end tags */
34 
41 
48 
54  protected $cmsIndex;
55 
64  public function __inject(
65  CustomerAccountCreate $customerAccountCreate,
67  CmsIndex $cmsIndex
68  ) {
69  $this->customerAccountLogout = $customerAccountLogout;
70  $this->customerAccountCreate = $customerAccountCreate;
71  $this->cmsIndex = $cmsIndex;
72  }
73 
80  public function testCreateExistingCustomer(Customer $customer)
81  {
82  // Precondition
83  $existingCustomer = clone $customer;
84  $customer->persist();
85 
86  // Steps
87  $this->cmsIndex->open();
88  $this->cmsIndex->getLinksBlock()->openLink('Create an Account');
89  $this->customerAccountCreate->getRegisterForm()->registerCustomer($existingCustomer);
90  }
91 
97  public function tearDown()
98  {
99  $this->objectManager->create(\Magento\Customer\Test\TestStep\LogoutCustomerOnFrontendStep::class)->run();
100  }
101 }
$customer
Definition: customers.php:11
__inject(CustomerAccountCreate $customerAccountCreate, CustomerAccountLogout $customerAccountLogout, CmsIndex $cmsIndex)