@@ -358,6 +358,67 @@ public function testCreateCustomerAddressWithRedundantStreetLine()
358
358
$ this ->graphQlMutation ($ mutation , [], '' , $ this ->getCustomerAuthHeaders ($ userName , $ password ));
359
359
}
360
360
361
+ /**
362
+ * @magentoApiDataFixture Magento/Customer/_files/customer_without_addresses.php
363
+ * @magentoConfigFixture default_store general/country/optional_zip_countries UA
364
+ *
365
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
366
+ */
367
+ public function testCreateCustomerAddressWithOptionalZipCode ()
368
+ {
369
+ $ newAddress = [
370
+ 'country_code ' => 'UA ' ,
371
+ 'street ' => ['Line 1 Street ' , 'Line 2 ' ],
372
+ 'company ' => 'Company name ' ,
373
+ 'telephone ' => '123456789 ' ,
374
+ 'fax ' => '123123123 ' ,
375
+ 'city ' => 'City Name ' ,
376
+ 'firstname ' => 'Adam ' ,
377
+ 'lastname ' => 'Phillis ' ,
378
+ 'middlename ' => 'A ' ,
379
+ 'prefix ' => 'Mr. ' ,
380
+ 'suffix ' => 'Jr. ' ,
381
+ 'vat_id ' => '1 ' ,
382
+ 'default_shipping ' => true ,
383
+ 'default_billing ' => false
384
+ ];
385
+
386
+ $ mutation
387
+ = <<<MUTATION
388
+ mutation {
389
+ createCustomerAddress(input: {
390
+ country_code: {$ newAddress ['country_code ' ]}
391
+ street: [" {$ newAddress ['street ' ][0 ]}"," {$ newAddress ['street ' ][1 ]}"]
392
+ company: " {$ newAddress ['company ' ]}"
393
+ telephone: " {$ newAddress ['telephone ' ]}"
394
+ fax: " {$ newAddress ['fax ' ]}"
395
+ city: " {$ newAddress ['city ' ]}"
396
+ firstname: " {$ newAddress ['firstname ' ]}"
397
+ lastname: " {$ newAddress ['lastname ' ]}"
398
+ middlename: " {$ newAddress ['middlename ' ]}"
399
+ prefix: " {$ newAddress ['prefix ' ]}"
400
+ suffix: " {$ newAddress ['suffix ' ]}"
401
+ vat_id: " {$ newAddress ['vat_id ' ]}"
402
+ default_shipping: true
403
+ default_billing: false
404
+ }) {
405
+ id
406
+ }
407
+ }
408
+ MUTATION ;
409
+
410
+
411
+ $ password = 'password ' ;
412
+
413
+ $ response = $ this ->graphQlMutation (
414
+ $ mutation ,
415
+ [],
416
+ '' ,
417
+ $ this ->getCustomerAuthHeaders ($ userName , $ password )
418
+ );
419
+ $ this ->assertNotEmpty ($ response ['createCustomerAddress ' ]['id ' ]);
420
+ }
421
+
361
422
/**
362
423
* Create new address with invalid input
363
424
*
0 commit comments