Skip to content

Commit 03a9a24

Browse files
committed
MC-32201: Reorder functionality (test coverage)
1 parent f873398 commit 03a9a24

File tree

9 files changed

+9
-14
lines changed

9 files changed

+9
-14
lines changed

app/code/Magento/Sales/Model/Reorder/Reorder.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class Reorder
4040
'The required options you selected are not available' => self::ERROR_NOT_SALABLE,
4141
'Product that you are trying to add is not available' => self::ERROR_NOT_SALABLE,
4242
'This product is out of stock' => self::ERROR_NOT_SALABLE,
43+
'There are no source items' => self::ERROR_NOT_SALABLE,
4344
'The fewest you may purchase is' => self::ERROR_INSUFFICIENT_STOCK,
4445
'The most you may purchase is' => self::ERROR_INSUFFICIENT_STOCK,
4546
'The requested qty is not available' => self::ERROR_INSUFFICIENT_STOCK,

dev/tests/api-functional/testsuite/Magento/GraphQl/Sales/ReorderConfigurableWithVariationsTest.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ private function assertValidVariations(): void
134134
* @throws NoSuchEntityException
135135
* @throws \Magento\Framework\Exception\CouldNotSaveException
136136
* @throws \Magento\Framework\Exception\InputException
137-
* @throws \Magento\Framework\Exception\StateException *@throws NoSuchEntityException
137+
* @throws \Magento\Framework\Exception\StateException
138+
* @throws NoSuchEntityException
138139
*/
139140
private function assertWithOutOfStockVariation(
140141
\Magento\Catalog\Api\ProductRepositoryInterface $productRepository,
@@ -200,8 +201,6 @@ private function assetProductNotSalable(array $response)
200201
'orderNumber',
201202
],
202203
'code' => 'NOT_SALABLE',
203-
'message' => 'Could not add the product with SKU "configurable" to the shopping cart:' .
204-
' This product is out of stock.',
205204
],
206205
],
207206
'cart' => [
@@ -241,8 +240,6 @@ private function assetProductUndefined(array $response): void
241240
'orderNumber',
242241
],
243242
'code' => 'UNDEFINED',
244-
'message' => 'Could not add the product with SKU "configurable" to the shopping cart: ' .
245-
'You need to choose options for your item.',
246243
],
247244
],
248245
'cart' => [
@@ -311,7 +308,6 @@ protected function getQuery($orderNumber): string
311308
userInputErrors {
312309
path
313310
code
314-
message
315311
}
316312
cart {
317313
email

dev/tests/api-functional/testsuite/Magento/GraphQl/Sales/ReorderMultipleProductsTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ protected function getQuery($orderNumber): string
174174
userInputErrors {
175175
path
176176
code
177-
message
178177
}
179178
cart {
180179
email

dev/tests/api-functional/testsuite/Magento/GraphQl/Sales/ReorderOverlayProductTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ protected function getQuery($orderNumber): string
190190
userInputErrors {
191191
path
192192
code
193-
message
194193
}
195194
cart {
196195
email

dev/tests/api-functional/testsuite/Magento/GraphQl/Sales/ReorderTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,6 @@ public function testReorderWithLowStock()
163163
[
164164
'path' => ['orderNumber'],
165165
'code' => 'INSUFFICIENT_STOCK',
166-
'message' => 'Could not add the product with SKU "simple" to the shopping cart: '
167-
. 'The requested qty is not available',
168166
],
169167
],
170168
'cart' => [
@@ -199,8 +197,6 @@ private function assertProductNotAvailable()
199197
[
200198
'path' => ['orderNumber'],
201199
'code' => 'NOT_SALABLE',
202-
'message' => 'Could not add the product with SKU "simple" to the shopping cart: '
203-
. 'Product that you are trying to add is not available.',
204200
],
205201
],
206202
'cart' => [
@@ -270,7 +266,6 @@ private function assertWithDeletedProduct(
270266
[
271267
'path' => ['orderNumber'],
272268
'code' => 'PRODUCT_NOT_FOUND',
273-
'message' => 'Could not find a product with ID "' . $productId . '"',
274269
],
275270
],
276271
'cart' => [
@@ -327,7 +322,6 @@ protected function getQuery($orderNumber): string
327322
userInputErrors {
328323
path
329324
code
330-
message
331325
}
332326
cart {
333327
email

dev/tests/integration/testsuite/Magento/Sales/_files/order_with_different_types_of_product_rollback.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
require __DIR__ . '/../../../Magento/GraphQl/Catalog/_files/virtual_product_rollback.php';
1111
require __DIR__ . '/../../../Magento/Bundle/_files/bundle_product_radio_required_option_rollback.php';
1212
require __DIR__ . '/../../../Magento/Downloadable/_files/product_downloadable_rollback.php';
13+
require 'default_rollback.php';

dev/tests/integration/testsuite/Magento/Sales/_files/order_with_simple_product_rollback.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
require __DIR__ . '/../../../Magento/Customer/_files/customer_rollback.php';
1010
require __DIR__ . '/../../../Magento/Catalog/_files/product_simple_rollback.php';
1111
require __DIR__ . '/../../../Magento/Catalog/_files/product_simple_without_custom_options_rollback.php';
12+
require 'default_rollback.php';

dev/tests/integration/testsuite/Magento/Sales/_files/order_with_two_simple_products_qty_10_rollback.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@
55
*/
66

77
require __DIR__ . '/../../../Magento/Customer/_files/customer_rollback.php';
8+
require __DIR__ . '/../../../Magento/Catalog/_files/product_simple_rollback.php';
9+
require __DIR__ . '/../../../Magento/Catalog/_files/product_simple_without_custom_options_rollback.php';
810
require 'default_rollback.php';

dev/tests/integration/testsuite/Magento/Sales/_files/order_with_two_simple_products_rollback.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@
55
*/
66

77
require __DIR__ . '/../../../Magento/Customer/_files/customer_rollback.php';
8+
require __DIR__ . '/../../../Magento/Catalog/_files/product_simple_rollback.php';
9+
require __DIR__ . '/../../../Magento/Catalog/_files/product_simple_without_custom_options_rollback.php';
810
require 'default_rollback.php';

0 commit comments

Comments
 (0)