@@ -67,18 +67,15 @@ public function testAddSimpleProductsToCart()
67
67
68
68
/**
69
69
* @magentoApiDataFixture Magento/Catalog/_files/products.php
70
-
71
70
* @magentoApiDataFixture Magento/Checkout/_files/active_quote.php
72
71
* @expectedException \Exception
73
- * @expectedExceptionMessage The most you may purchase is 5.
72
+ * @expectedExceptionMessage The requested qty is not available
74
73
*/
75
- public function testAddMoreProductsThatAllowed ()
74
+ public function testAddProductIfQuantityIsNotAvailable ()
76
75
{
77
76
$ sku = 'simple ' ;
78
- $ qty = 7 ;
79
- $ maxQty = 5 ;
77
+ $ qty = 200 ;
80
78
81
- $ this ->config ->saveConfig ('cataloginventory/item_options/max_sale_qty ' , $ maxQty , 'default ' , 0 );
82
79
$ maskedQuoteId = $ this ->getMaskedQuoteId ();
83
80
$ query = $ this ->getQueryAddSimpleProduct ($ maskedQuoteId , $ sku , $ qty );
84
81
$ this ->graphQlQuery ($ query );
@@ -87,22 +84,22 @@ public function testAddMoreProductsThatAllowed()
87
84
/**
88
85
* @magentoApiDataFixture Magento/Catalog/_files/products.php
89
86
* @magentoApiDataFixture Magento/Checkout/_files/active_quote.php
90
- * @expectedException \Exception
91
- * @expectedExceptionMessage The requested qty is not available
87
+ * @expectedExceptionMessage The most you may purchase is 5.
92
88
*/
93
- public function testAddProductIfQuantityIsNotAvailable ()
89
+ public function testAddMoreProductsThatAllowed ()
94
90
{
95
- $ sku = 'simple ' ;
96
- $ qty = 200 ;
91
+ $ sku = 'custom-design-simple-product ' ;
92
+ $ qty = 7 ;
93
+ $ maxQty = 5 ;
97
94
95
+ $ this ->config ->saveConfig ('cataloginventory/item_options/max_sale_qty ' , $ maxQty , 'default ' , 0 );
98
96
$ maskedQuoteId = $ this ->getMaskedQuoteId ();
99
97
$ query = $ this ->getQueryAddSimpleProduct ($ maskedQuoteId , $ sku , $ qty );
100
98
$ this ->graphQlQuery ($ query );
101
99
}
102
100
103
101
/**
104
102
* @return string
105
- * @throws \Magento\Framework\Exception\NoSuchEntityException
106
103
*/
107
104
public function getMaskedQuoteId () : string
108
105
{
0 commit comments