Skip to content

Commit 240cfb3

Browse files
author
vitaliyboyko
committed
graphQl: fixed typos and wrong descriptions
1 parent c857857 commit 240cfb3

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function execute(ContextInterface $context, CartInterface $cart, array $s
5959
{
6060
if (count($shippingAddresses) > 1) {
6161
throw new GraphQlInputException(
62-
__('Multiple addresses do not allowed here!')
62+
__('You cannot specify multiple shipping addresses.')
6363
);
6464
}
6565
$shippingAddress = current($shippingAddresses);
@@ -68,19 +68,19 @@ public function execute(ContextInterface $context, CartInterface $cart, array $s
6868

6969
if (!$customerAddressId && !$addressInput) {
7070
throw new GraphQlInputException(
71-
__('Shipping address should contain either "customer_address_id" or "address" input.')
71+
__('The shipping address must contain either "customer_address_id" or "address".')
7272
);
7373
}
7474
if ($customerAddressId && $addressInput) {
7575
throw new GraphQlInputException(
76-
__('Shipping address can\'t contain "customer_address_id" and "address" input at the same time.')
76+
__('The shipping address cannot contain "customer_address_id" and "address" at the same time.')
7777
);
7878
}
7979
if ($customerAddressId) {
8080
if ((!$context->getUserId()) || $context->getUserType() == UserContextInterface::USER_TYPE_GUEST) {
8181
throw new GraphQlAuthorizationException(
8282
__(
83-
'Address management allowed only for authorized customers.'
83+
'Guest users cannot manage addresses.'
8484
)
8585
);
8686
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
/**
1515
* Extension point for setting shipping addresses for a specified shopping cart
1616
*
17-
* All objects that are responsible for set shipping addresses on cart via GraphQl should implement this interface.
17+
* All objects that are responsible for setting shipping addresses on a cart via GraphQl
18+
*should implement this interface.
1819
*/
1920
interface SetShippingAddressesOnCartInterface
2021
{

app/code/Magento/QuoteGraphQl/etc/schema.graphqls

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ type Query {
66
}
77

88
type Mutation {
9-
createEmptyCart: String @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\Cart\\CreateEmptyCart") @doc(description:"Creates empty shopping cart for guest or logged in user")
9+
createEmptyCart: String @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\Cart\\CreateEmptyCart") @doc(description:"Creates an empty shopping cart for a guest or logged in user")
1010
applyCouponToCart(input: ApplyCouponToCartInput): ApplyCouponToCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\Coupon\\ApplyCouponToCart")
1111
removeCouponFromCart(input: RemoveCouponFromCartInput): RemoveCouponFromCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\Coupon\\RemoveCouponFromCart")
1212
setShippingAddressesOnCart(input: SetShippingAddressesOnCartInput): SetShippingAddressesOnCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetShippingAddressesOnCart")
13-
createEmptyCart: String @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CreateEmptyCart") @doc(description:"Creates empty shopping cart for guest or logged in user")
1413
applyCouponToCart(input: ApplyCouponToCartInput): ApplyCouponToCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ApplyCouponToCart")
1514
removeCouponFromCart(input: RemoveCouponFromCartInput): RemoveCouponFromCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\RemoveCouponFromCart")
1615
setBillingAddressOnCart(input: SetBillingAddressOnCartInput): SetBillingAddressOnCartOutput

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,12 @@ public function testSetSavedShippingAddressOnCartByGuest()
139139
}
140140
}
141141
QUERY;
142-
self::expectExceptionMessage('Address management allowed only for authorized customers.');
142+
self::expectExceptionMessage('Guest users cannot manage addresses.');
143143
$this->graphQlQuery($query);
144144
}
145145

146146
/**
147147
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_simple_product_saved.php
148-
* @magentoConfigFixture default_store multishipping/options/checkout_multiple 0
149148
*/
150149
public function testSetMultipleShippingAddressesOnCartByGuest()
151150
{
@@ -185,7 +184,7 @@ public function testSetMultipleShippingAddressesOnCartByGuest()
185184
}
186185
}
187186
QUERY;
188-
self::expectExceptionMessage('Multiple addresses do not allowed here!');
187+
self::expectExceptionMessage('You cannot specify multiple shipping addresses.');
189188
$this->graphQlQuery($query);
190189
}
191190

@@ -240,7 +239,7 @@ public function testSetSavedAndNewShippingAddressOnCartAtTheSameTime()
240239
}
241240
QUERY;
242241
self::expectExceptionMessage(
243-
'Shipping address can\'t contain "customer_address_id" and "address" input at the same time.'
242+
'The shipping address cannot contain "customer_address_id" and "address" at the same time.'
244243
);
245244
$this->graphQlQuery($query);
246245
}
@@ -282,7 +281,7 @@ public function testSetShippingAddressOnCartWithNoAddresses()
282281
}
283282
QUERY;
284283
self::expectExceptionMessage(
285-
'Shipping address should contain either "customer_address_id" or "address" input.'
284+
'The shipping address must contain either "customer_address_id" or "address".'
286285
);
287286
$this->graphQlQuery($query);
288287
}

0 commit comments

Comments
 (0)