Skip to content

Commit 04c9e4a

Browse files
committed
#30218 Write api functional tests tests for getting and setting, new address without telephone.
1 parent 8790241 commit 04c9e4a

File tree

6 files changed

+187
-273
lines changed

6 files changed

+187
-273
lines changed

dev/tests/api-functional/config/install-config-mysql.php.dist

Lines changed: 0 additions & 30 deletions
This file was deleted.

dev/tests/api-functional/phpunit_rest.xml.dist

Lines changed: 0 additions & 121 deletions
This file was deleted.

dev/tests/api-functional/phpunit_soap.xml.dist

Lines changed: 0 additions & 120 deletions
This file was deleted.

dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetSpecifiedBillingAddressTest.php

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,13 @@ private function getQuery(string $maskedQuoteId): string
164164
company
165165
street
166166
city
167-
region
167+
region
168168
{
169169
code
170170
label
171171
}
172172
postcode
173-
country
173+
country
174174
{
175175
code
176176
label
@@ -195,4 +195,44 @@ private function getHeaderMap(string $username = 'customer@example.com', string
195195
$headerMap = ['Authorization' => 'Bearer ' . $customerToken];
196196
return $headerMap;
197197
}
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+
}
198238
}

0 commit comments

Comments
 (0)