Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CaptchaOnStoreFrontRegisterTest.php
Go to the documentation of this file.
1 <?php
8 
11 use Magento\Customer\Test\Page\CustomerAccountCreate;
12 use Magento\Mtf\TestCase\Injectable;
13 use Magento\Mtf\TestStep\TestStepFactory;
14 
26 class CaptchaOnStoreFrontRegisterTest extends Injectable
27 {
33  private $stepFactory;
34 
40  private $assertCaptcha;
41 
47  private $customerAccountCreate;
48 
54  private $configData;
55 
64  public function __inject(
65  TestStepFactory $stepFactory,
66  AssertCaptchaFieldOnRegisterForm $assertCaptcha,
67  CustomerAccountCreate $customerAccount
68  ) {
69  $this->stepFactory = $stepFactory;
70  $this->assertCaptcha = $assertCaptcha;
71  $this->customerAccountCreate = $customerAccount;
72  }
73 
81  public function test(
83  $configData
84  ) {
85  $this->configData = $configData;
86 
87  // Preconditions
88  $this->stepFactory->create(
89  \Magento\Config\Test\TestStep\SetupConfigurationStep::class,
90  ['configData' => $this->configData]
91  )->run();
92 
93  $this->customerAccountCreate->open();
94  $this->assertCaptcha->processAssertRegisterForm($this->customerAccountCreate);
95  $this->customerAccountCreate->getRegisterForm()->reloadCaptcha();
96  $this->customerAccountCreate->getRegisterForm()->registerCustomer($customer);
97  }
98 
104  public function tearDown()
105  {
106  $this->stepFactory->create(
107  \Magento\Config\Test\TestStep\SetupConfigurationStep::class,
108  ['configData' => $this->configData, 'rollback' => true]
109  )->run();
110  }
111 }
__inject(TestStepFactory $stepFactory, AssertCaptchaFieldOnRegisterForm $assertCaptcha, CustomerAccountCreate $customerAccount)
$customer
Definition: customers.php:11