Skip to content

Commit c287f03

Browse files
author
Serhii Bohomaz
committed
MC-37099: Create automated test for "Update Customer Address, with Alphanumeric Zip Code"
1 parent 40fe02b commit c287f03

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

dev/tests/integration/testsuite/Magento/Customer/Model/ResourceModel/AddressRepositoryTest.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public function testSaveAddressesIdSetButNotAlreadyExisting(): void
157157
'No such entity with %fieldName = %fieldValue',
158158
[
159159
'fieldName' => 'addressId',
160-
'fieldValue' => 4200
160+
'fieldValue' => 4200,
161161
]
162162
);
163163
$this->expectException(NoSuchEntityException::class);
@@ -195,7 +195,7 @@ public function testGetAddressByIdBadAddressId(): void
195195
'No such entity with %fieldName = %fieldValue',
196196
[
197197
'fieldName' => 'addressId',
198-
'fieldValue' => 12345
198+
'fieldValue' => 12345,
199199
]
200200
);
201201
$this->expectException(NoSuchEntityException::class);
@@ -299,7 +299,7 @@ public function testSaveAddressesCustomerIdNotExist(): void
299299
'No such entity with %fieldName = %fieldValue',
300300
[
301301
'fieldName' => 'customerId',
302-
'fieldValue' => 4200
302+
'fieldValue' => 4200,
303303
]
304304
);
305305
$this->expectException(NoSuchEntityException::class);
@@ -319,7 +319,7 @@ public function testSaveAddressesCustomerIdInvalid(): void
319319
'No such entity with %fieldName = %fieldValue',
320320
[
321321
'fieldName' => 'customerId',
322-
'fieldValue' => 'this_is_not_a_valid_id'
322+
'fieldValue' => 'this_is_not_a_valid_id',
323323
]
324324
);
325325
$this->expectException(NoSuchEntityException::class);
@@ -347,7 +347,7 @@ public function testDeleteAddress(): void
347347
'No such entity with %fieldName = %fieldValue',
348348
[
349349
'fieldName' => 'addressId',
350-
'fieldValue' => 1
350+
'fieldValue' => 1,
351351
]
352352
);
353353
$this->expectException(NoSuchEntityException::class);
@@ -375,7 +375,7 @@ public function testDeleteAddressById(): void
375375
'No such entity with %fieldName = %fieldValue',
376376
[
377377
'fieldName' => 'addressId',
378-
'fieldValue' => 1
378+
'fieldValue' => 1,
379379
]
380380
);
381381
$this->expectException(NoSuchEntityException::class);
@@ -395,7 +395,7 @@ public function testDeleteAddressFromCustomerBadAddressId(): void
395395
'No such entity with %fieldName = %fieldValue',
396396
[
397397
'fieldName' => 'addressId',
398-
'fieldValue' => 12345
398+
'fieldValue' => 12345,
399399
]
400400
);
401401
$this->expectException(NoSuchEntityException::class);
@@ -482,7 +482,7 @@ public function searchAddressDataProvider(): array
482482
null,
483483
null,
484484
[
485-
['id' => 1, 'city' => 'CityM', 'postcode' => 75477, 'firstname' => 'John'],
485+
['id' => 1, 'city' => 'CityM', 'postcode' => 75477, 'firstname' => 'John',],
486486
],
487487
1
488488
],
@@ -491,7 +491,7 @@ public function searchAddressDataProvider(): array
491491
null,
492492
null,
493493
[
494-
['id' => 1, 'city' => 'CityM', 'postcode' => 75477, 'firstname' => 'John'],
494+
['id' => 1, 'city' => 'CityM', 'postcode' => 75477, 'firstname' => 'John',],
495495
],
496496
1
497497
],
@@ -503,8 +503,8 @@ public function searchAddressDataProvider(): array
503503
$orderBuilder->setField('city')->setDirection(SortOrder::SORT_ASC)->create(),
504504
],
505505
[
506-
['id' => 1, 'city' => 'CityM', 'postcode' => 75477, 'firstname' => 'John'],
507-
['id' => 2, 'city' => 'CityX', 'postcode' => 47676, 'firstname' => 'John'],
506+
['id' => 1, 'city' => 'CityM', 'postcode' => 75477, 'firstname' => 'John',],
507+
['id' => 2, 'city' => 'CityX', 'postcode' => 47676, 'firstname' => 'John',],
508508
],
509509
2
510510
],
@@ -518,8 +518,8 @@ public function searchAddressDataProvider(): array
518518
$orderBuilder->setField('city')->setDirection(SortOrder::SORT_DESC)->create(),
519519
],
520520
[
521-
['id' => 2, 'city' => 'CityX', 'postcode' => 47676, 'firstname' => 'John'],
522-
['id' => 1, 'city' => 'CityM', 'postcode' => 75477, 'firstname' => 'John'],
521+
['id' => 2, 'city' => 'CityX', 'postcode' => 47676, 'firstname' => 'John',],
522+
['id' => 1, 'city' => 'CityM', 'postcode' => 75477, 'firstname' => 'John',],
523523
],
524524
2
525525
],
@@ -531,8 +531,8 @@ public function searchAddressDataProvider(): array
531531
$orderBuilder->setField('postcode')->setDirection(SortOrder::SORT_ASC)->create(),
532532
],
533533
[
534-
['id' => 2, 'city' => 'CityX', 'postcode' => 47676, 'firstname' => 'John'],
535-
['id' => 1, 'city' => 'CityM', 'postcode' => 75477, 'firstname' => 'John'],
534+
['id' => 2, 'city' => 'CityX', 'postcode' => 47676, 'firstname' => 'John',],
535+
['id' => 1, 'city' => 'CityM', 'postcode' => 75477, 'firstname' => 'John',],
536536
],
537537
2
538538
],
@@ -662,8 +662,8 @@ public function testUpdateWithAlphanumericZipCode(): void
662662
$savedAddress = $this->repository->save($customerAddress);
663663
$customerData = $savedAddress->__toArray();
664664
foreach ($addressData as $key => $value) {
665-
if ($key === 'region') {
666-
$this->assertEquals('Pinminnoch', $value->getRegion());
665+
if ($key === AddressInterface::REGION) {
666+
$this->assertEquals($customerData[$key][AddressInterface::REGION], $value->getRegion());
667667
} else {
668668
$this->assertEquals($value, $customerData[$key]);
669669
}

0 commit comments

Comments
 (0)