@@ -164,13 +164,13 @@ private function getQuery(string $maskedQuoteId): string
164
164
company
165
165
street
166
166
city
167
- region
167
+ region
168
168
{
169
169
code
170
170
label
171
171
}
172
172
postcode
173
- country
173
+ country
174
174
{
175
175
code
176
176
label
@@ -195,4 +195,44 @@ private function getHeaderMap(string $username = 'customer@example.com', string
195
195
$ headerMap = ['Authorization ' => 'Bearer ' . $ customerToken ];
196
196
return $ headerMap ;
197
197
}
198
+
199
+ /**
200
+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
201
+ * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
202
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
203
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
204
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address_without_telephone.php
205
+ */
206
+ public function testGetSpecifiedBillingAddressWithoutTelephone ()
207
+ {
208
+ $ maskedQuoteId = $ this ->getMaskedQuoteIdByReservedOrderId ->execute ('test_quote ' );
209
+ $ query = $ this ->getQuery ($ maskedQuoteId );
210
+
211
+ $ response = $ this ->graphQlQuery ($ query , [], '' , $ this ->getHeaderMap ());
212
+ self ::assertArrayHasKey ('cart ' , $ response );
213
+ self ::assertArrayHasKey ('billing_address ' , $ response ['cart ' ]);
214
+
215
+ $ expectedBillingAddressData = [
216
+ 'firstname ' => 'John ' ,
217
+ 'lastname ' => 'Smith ' ,
218
+ 'company ' => 'CompanyName ' ,
219
+ 'street ' => [
220
+ 'Green str, 67 '
221
+ ],
222
+ 'city ' => 'CityM ' ,
223
+ 'region ' => [
224
+ 'code ' => 'AL ' ,
225
+ 'label ' => 'Alabama ' ,
226
+ ],
227
+ 'postcode ' => '75477 ' ,
228
+ 'country ' => [
229
+ 'code ' => 'US ' ,
230
+ 'label ' => 'US ' ,
231
+ ],
232
+ 'telephone ' => '' ,
233
+ '__typename ' => 'BillingCartAddress ' ,
234
+ 'customer_notes ' => null ,
235
+ ];
236
+ self ::assertEquals ($ expectedBillingAddressData , $ response ['cart ' ]['billing_address ' ]);
237
+ }
198
238
}
0 commit comments