|
8 | 8 | namespace Magento\GraphQl\Quote\Guest;
|
9 | 9 |
|
10 | 10 | use Exception;
|
| 11 | +use Magento\Framework\Exception\NoSuchEntityException; |
11 | 12 | use Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId;
|
12 | 13 | use Magento\TestFramework\Helper\Bootstrap;
|
13 | 14 | use Magento\TestFramework\TestCase\GraphQl\ResponseContainsErrorsException;
|
@@ -107,22 +108,26 @@ public function testAddDisabledProductToCart(): void
|
107 | 108 | /**
|
108 | 109 | * Add out of stock product to cart
|
109 | 110 | *
|
110 |
| - * @magentoApiDataFixture Magento/Catalog/_files/product_virtual_out_of_stock.php |
| 111 | + * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php |
| 112 | + * @magentoApiDataFixture Magento/Catalog/_files/multiple_products.php |
111 | 113 | * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
|
| 114 | + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/set_guest_email.php |
| 115 | + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php |
| 116 | + * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/set_simple_product_out_of_stock.php |
112 | 117 | * @return void
|
| 118 | + * @throws NoSuchEntityException |
113 | 119 | */
|
114 | 120 | public function testAddOutOfStockProductToCart(): void
|
115 | 121 | {
|
116 |
| - $sku = 'virtual-product-out'; |
117 |
| - $quantity = 2; |
| 122 | + $sku = 'simple1'; |
| 123 | + $quantity = 1; |
118 | 124 |
|
119 | 125 | $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
|
120 | 126 | $query = $this->getQuery($maskedQuoteId, $sku, $quantity);
|
121 | 127 |
|
122 | 128 | $this->expectException(ResponseContainsErrorsException::class);
|
123 | 129 | $this->expectExceptionMessage(
|
124 |
| - 'Could not add the product with SKU ' . $sku . ' to the shopping cart: ' . |
125 |
| - 'Product that you are trying to add is not available.' |
| 130 | + 'Some of the products are out of stock.' |
126 | 131 | );
|
127 | 132 |
|
128 | 133 | $this->graphQlMutation($query);
|
|
0 commit comments