Skip to content

Commit b39441a

Browse files
committed
graphQl-509: save_in_address_book has no impact on Address Book
1 parent 4853146 commit b39441a

File tree

4 files changed

+0
-107
lines changed

4 files changed

+0
-107
lines changed

app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,6 @@ private function createBillingAddress(
116116
if (0 !== $customerId && !empty($addressInput['save_in_address_book'])) {
117117
$this->saveQuoteAddressToCustomerAddressBook->execute($billingAddress, $customerId);
118118
}
119-
120-
if (0 === $customerId) {
121-
throw new GraphQlAuthorizationException(__('The current customer isn\'t authorized.'));
122-
}
123119
} else {
124120
if (false === $context->getExtensionAttributes()->getIsCustomer()) {
125121
throw new GraphQlAuthorizationException(__('The current customer isn\'t authorized.'));

app/code/Magento/QuoteGraphQl/Model/Cart/SetShippingAddressesOnCart.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,6 @@ private function createShippingAddress(
107107
if (0 !== $customerId && !empty($addressInput['save_in_address_book'])) {
108108
$this->saveQuoteAddressToCustomerAddressBook->execute($shippingAddress, $customerId);
109109
}
110-
111-
if (0 === $customerId) {
112-
throw new GraphQlAuthorizationException(__('The current customer isn\'t authorized.'));
113-
}
114110
} else {
115111
if (false === $context->getExtensionAttributes()->getIsCustomer()) {
116112
throw new GraphQlAuthorizationException(__('The current customer isn\'t authorized.'));

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

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -651,55 +651,6 @@ public function testSetNewBillingAddressWithRedundantStreetLine()
651651
$this->graphQlMutation($query, [], '', $this->getHeaderMap());
652652
}
653653

654-
/**
655-
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
656-
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
657-
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
658-
*/
659-
public function testSetBillingAddressToGuestCartWithoutAddressId()
660-
{
661-
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
662-
663-
$query = <<<QUERY
664-
mutation {
665-
setBillingAddressOnCart(
666-
input: {
667-
cart_id: "{$maskedQuoteId}"
668-
billing_address: {
669-
address: {
670-
firstname: "test firstname"
671-
lastname: "test lastname"
672-
company: "test company"
673-
street: ["test street 1", "test street 2"]
674-
city: "test city"
675-
region: "test region"
676-
postcode: "887766"
677-
country_code: "US"
678-
telephone: "88776655"
679-
}
680-
}
681-
}
682-
) {
683-
cart {
684-
shipping_addresses {
685-
region {
686-
code
687-
}
688-
country {
689-
code
690-
}
691-
}
692-
}
693-
}
694-
}
695-
QUERY;
696-
$this->expectExceptionMessage(
697-
'The current customer isn\'t authorized.'
698-
);
699-
700-
$this->graphQlMutation($query, [], '');
701-
}
702-
703654
/**
704655
* @magentoApiDataFixture Magento/Customer/_files/customer.php
705656
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php

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

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -619,56 +619,6 @@ public function testSetShippingAddressToGuestCart()
619619
$this->graphQlMutation($query, [], '', $this->getHeaderMap());
620620
}
621621

622-
/**
623-
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
624-
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
625-
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
626-
*/
627-
public function testSetShippingAddressToGuestCartWithoutAddressId()
628-
{
629-
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
630-
631-
$query = <<<QUERY
632-
mutation {
633-
setShippingAddressesOnCart(
634-
input: {
635-
cart_id: "{$maskedQuoteId}"
636-
shipping_addresses: [
637-
{
638-
address: {
639-
firstname: "John"
640-
lastname: "Doe"
641-
street: ["6161 West Centinella Avenue"]
642-
city: "Culver City"
643-
region: "CA"
644-
postcode: "90230"
645-
country_code: "us"
646-
telephone: "555-555-55-55"
647-
}
648-
}
649-
]
650-
}
651-
) {
652-
cart {
653-
shipping_addresses {
654-
region {
655-
code
656-
}
657-
country {
658-
code
659-
}
660-
}
661-
}
662-
}
663-
}
664-
QUERY;
665-
$this->expectExceptionMessage(
666-
'The current customer isn\'t authorized.'
667-
);
668-
669-
$this->graphQlMutation($query, [], '');
670-
}
671-
672622
/**
673623
* @magentoApiDataFixture Magento/Customer/_files/customer.php
674624
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php

0 commit comments

Comments
 (0)