Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
RegisterCustomerEntityWithDifferentPasswordClassesTest.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Customer\Test\Page\CustomerAccountCreate;
11 use Magento\Cms\Test\Page\CmsIndex;
12 use Magento\Mtf\TestCase\Injectable;
13 use Magento\Mtf\TestStep\TestStepFactory;
15 
27 {
28  /* tags */
29  const MVP = 'yes';
30  const SEVERITY = 'S1';
31  /* end tags */
32 
39 
45  protected $cmsIndex;
46 
52  protected $testStepFactory;
53 
62  public function __inject(
63  CustomerAccountCreate $customerAccountCreate,
64  CmsIndex $cmsIndex,
65  TestStepFactory $testStepFactory
66  ) {
67  $this->customerAccountCreate = $customerAccountCreate;
68  $this->cmsIndex = $cmsIndex;
69  $this->testStepFactory = $testStepFactory;
70  }
71 
79  public function test(Customer $customer, ConfigData $config)
80  {
81  // Preconditions
82  $config->persist();
83  // Steps
84  $this->cmsIndex->open();
85  $this->cmsIndex->getLinksBlock()->openLink('Create an Account');
86  $this->customerAccountCreate->getRegisterForm()->registerCustomer($customer);
87 
88  $characterClassesNumber = $config
89  ->getData('section')['customer/password/required_character_classes_number']['value'];
90 
91  return ['characterClassesNumber' => $characterClassesNumber];
92  }
93 
99  protected function tearDown()
100  {
101  //Set default required character classes for the password
102  $this->objectManager->create(
103  \Magento\Config\Test\TestStep\SetupConfigurationStep::class,
104  ['configData' => 'default_required_character_classes_number']
105  )->run();
106  // Logout customer
107  $this->testStepFactory->create(
108  \Magento\Customer\Test\TestStep\LogoutCustomerOnFrontendStep::class
109  )->run();
110  }
111 }
$customer
Definition: customers.php:11
$config
Definition: fraud_order.php:17
__inject(CustomerAccountCreate $customerAccountCreate, CmsIndex $cmsIndex, TestStepFactory $testStepFactory)