Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ApplyVatIdTest.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Customer\Test\Fixture\Address;
11 use Magento\Customer\Test\Page\CustomerAccountIndex;
12 use Magento\Customer\Test\Page\CustomerAddressEdit;
14 
32 {
33  /* tags */
34  const MVP = 'no';
35  const TEST_TYPE = '3rd_party_test';
36  /* end tags */
37 
44 
51 
59  public function __inject(CustomerAccountIndex $customerAccountIndex, CustomerAddressEdit $customerAddressEdit)
60  {
61  $this->customerAccountIndex = $customerAccountIndex;
62  $this->customerAddressEdit = $customerAddressEdit;
63  }
64 
75  public function test(
76  Customer $customer,
77  Address $vatId,
78  ConfigData $vatConfig,
80  $customerGroup
81  ) {
82  // Preconditions
83  $this->configData = $configData;
84  $this->customer = $customer;
85  $this->objectManager->create(
86  \Magento\Config\Test\TestStep\SetupConfigurationStep::class,
87  ['configData' => $this->configData]
88  )->run();
89  $this->customer->persist();
90  $this->prepareVatConfig($vatConfig, $customerGroup);
91 
92  // Steps
93  $this->objectManager->create(
94  \Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep::class,
95  ['customer' => $this->customer]
96  )->run();
97  $this->customerAccountIndex->getDashboardAddress()->editBillingAddress();
98  $this->customerAddressEdit->getEditForm()->fill($vatId);
99  $this->customerAddressEdit->getEditForm()->saveAddress();
100 
101  return ['customer' => $this->customer];
102  }
103 }
test(Customer $customer, Address $vatId, ConfigData $vatConfig, $configData, $customerGroup)
__inject(CustomerAccountIndex $customerAccountIndex, CustomerAddressEdit $customerAddressEdit)
prepareVatConfig(ConfigData $vatConfig, $customerGroup)