File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
app/code/Magento/Customer/Observer
dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,7 @@ public function execute(\Magento\Framework\Event\Observer $observer)
127
127
if (!$ this ->_customerAddress ->isVatValidationEnabled ($ customer ->getStore ())
128
128
|| $ this ->_coreRegistry ->registry (self ::VIV_PROCESSED_FLAG )
129
129
|| !$ this ->_canProcessAddress ($ customerAddress )
130
+ || $ customerAddress ->getShouldIgnoreValidation ()
130
131
) {
131
132
return ;
132
133
}
@@ -136,7 +137,6 @@ public function execute(\Magento\Framework\Event\Observer $observer)
136
137
137
138
if ($ customerAddress ->getVatId () == ''
138
139
|| !$ this ->_customerVat ->isCountryInEU ($ customerAddress ->getCountry ())
139
- || $ customerAddress ->getShouldIgnoreValidation ()
140
140
) {
141
141
$ defaultGroupId = $ this ->_groupManagement ->getDefaultGroup ($ customer ->getStore ())->getId ();
142
142
if (!$ customer ->getDisableAutoGroupChange () && $ customer ->getGroupId () != $ defaultGroupId ) {
Original file line number Diff line number Diff line change @@ -144,8 +144,7 @@ public function inlineEditParametersDataProvider(): array
144
144
*/
145
145
public function testInlineEditActionWithAddress (): void
146
146
{
147
- $ customer = $ this ->customerRepository ->get ('customer_one_address@test.com ' );
148
- $ this ->changeCustomerAddress ((int )$ customer ->getDefaultShipping ());
147
+ $ customer = $ this ->getCustomer ();
149
148
$ params = [
150
149
'items ' => [
151
150
$ customer ->getId () => []
@@ -166,17 +165,19 @@ public function testInlineEditActionWithAddress(): void
166
165
/**
167
166
* Change customer address with setting country from EU and setting VAT number
168
167
*
169
- * @param int $customerAddressId
170
- * @return void
168
+ * @return CustomerInterface
171
169
*/
172
- private function changeCustomerAddress ( int $ customerAddressId ): void
170
+ private function getCustomer ( ): CustomerInterface
173
171
{
174
- $ address = $ this ->addressRepository ->getById ($ customerAddressId );
172
+ $ customer = $ this ->customerRepository ->get ('customer_one_address@test.com ' );
173
+ $ address = $ this ->addressRepository ->getById ((int )$ customer ->getDefaultShipping ());
175
174
$ address ->setVatId (12345 );
176
175
$ address ->setCountryId ('DE ' );
177
176
$ address ->setRegionId (0 );
178
177
$ this ->addressRepository ->save ($ address );
179
178
$ this ->coreRegistry ->unregister (AfterAddressSaveObserver::VIV_PROCESSED_FLAG );
179
+ //return customer after address repository save
180
+ return $ this ->customerRepository ->get ('customer_one_address@test.com ' );
180
181
}
181
182
182
183
/**
You can’t perform that action at this time.
0 commit comments