File tree Expand file tree Collapse file tree 1 file changed +29
-1
lines changed
dev/tests/api-functional/testsuite/Magento/GraphQl/Quote Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -161,7 +161,35 @@ public function testSetShippingMethodWithNonExistingAddress()
161
161
$ this ->sendRequestWithToken ($ query );
162
162
}
163
163
164
- // TODO: TBD - add check for guest with attempt to set shipping method to the customer's shopping cart
164
+ /**
165
+ * @magentoApiDataFixture Magento/Checkout/_files/quote_with_address_saved.php
166
+ */
167
+ public function testSetShippingMethodByGuestToCustomerCart ()
168
+ {
169
+ $ shippingCarrierCode = 'flatrate ' ;
170
+ $ shippingMethodCode = 'flatrate ' ;
171
+ $ this ->quoteResource ->load (
172
+ $ this ->quote ,
173
+ 'test_order_1 ' ,
174
+ 'reserved_order_id '
175
+ );
176
+ $ shippingAddress = $ this ->quote ->getShippingAddress ();
177
+ $ shippingAddressId = $ shippingAddress ->getId ();
178
+ $ maskedQuoteId = $ this ->quoteIdToMaskedId ->execute ((int )$ this ->quote ->getId ());
179
+
180
+ $ query = $ this ->prepareMutationQuery (
181
+ $ maskedQuoteId ,
182
+ $ shippingMethodCode ,
183
+ $ shippingCarrierCode ,
184
+ $ shippingAddressId
185
+ );
186
+
187
+ self ::expectExceptionMessage (
188
+ "The current user cannot perform operations on cart \"$ maskedQuoteId \""
189
+ );
190
+
191
+ $ this ->graphQlQuery ($ query );
192
+ }
165
193
166
194
/**
167
195
* Generates query for setting the specified shipping method on cart
You can’t perform that action at this time.
0 commit comments