@@ -163,6 +163,48 @@ public function testMergeTwoCustomerCarts()
163
163
$ this ->graphQlMutation ($ query , [], '' , $ this ->getHeaderMap ());
164
164
}
165
165
166
+ /**
167
+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
168
+ * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
169
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
170
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
171
+ * @expectedException \Exception
172
+ * @expectedExceptionMessage Required parameter "source_cart_id" is missing
173
+ */
174
+ public function testMergeCartsWithEmptySourceCartId ()
175
+ {
176
+ $ customerQuote = $ this ->quoteFactory ->create ();
177
+ $ this ->quoteResource ->load ($ customerQuote , 'test_quote ' , 'reserved_order_id ' );
178
+
179
+ $ customerQuoteMaskedId = $ this ->quoteIdToMaskedId ->execute ((int )$ customerQuote ->getId ());
180
+ $ guestQuoteMaskedId = "" ;
181
+
182
+ $ query = $ this ->getCartMergeMutation ($ guestQuoteMaskedId , $ customerQuoteMaskedId );
183
+ $ this ->graphQlMutation ($ query , [], '' , $ this ->getHeaderMap ());
184
+ }
185
+
186
+ /**
187
+ * @magentoApiDataFixture Magento/Checkout/_files/quote_with_virtual_product_saved.php
188
+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
189
+ * @expectedException \Exception
190
+ * @expectedExceptionMessage Required parameter "destination_cart_id" is missing
191
+ */
192
+ public function testMergeCartsWithEmptyDestinationCartId ()
193
+ {
194
+ $ guestQuote = $ this ->quoteFactory ->create ();
195
+ $ this ->quoteResource ->load (
196
+ $ guestQuote ,
197
+ 'test_order_with_virtual_product_without_address ' ,
198
+ 'reserved_order_id '
199
+ );
200
+
201
+ $ customerQuoteMaskedId = "" ;
202
+ $ guestQuoteMaskedId = $ this ->quoteIdToMaskedId ->execute ((int )$ guestQuote ->getId ());
203
+
204
+ $ query = $ this ->getCartMergeMutation ($ guestQuoteMaskedId , $ customerQuoteMaskedId );
205
+ $ this ->graphQlMutation ($ query , [], '' , $ this ->getHeaderMap ());
206
+ }
207
+
166
208
/**
167
209
* Add simple product to cart
168
210
*
0 commit comments