File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
dev/tests/api-functional/testsuite/Magento/GraphQl/Quote Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,45 @@ public function testAddProductIfQuantityIsNotAvailable()
81
81
}
82
82
}
83
83
}
84
+ QUERY ;
85
+
86
+ $ this ->graphQlQuery ($ query );
87
+ }
88
+
89
+ /**
90
+ * @magentoApiDataFixture Magento/Catalog/_files/products.php
91
+ * @expectedException \Exception
92
+ * @expectedExceptionMessage Could not find a cart with ID "wrong_cart_hash"
93
+ */
94
+ public function testAddProductWithWrongCartHash ()
95
+ {
96
+ $ sku = 'simple ' ;
97
+ $ qty = 1 ;
98
+
99
+ $ maskedQuoteId = 'wrong_cart_hash ' ;
100
+
101
+ $ query = <<<QUERY
102
+ mutation {
103
+ addSimpleProductsToCart(
104
+ input: {
105
+ cart_id: " {$ maskedQuoteId }"
106
+ cartItems: [
107
+ {
108
+ data: {
109
+ qty: $ qty
110
+ sku: " $ sku"
111
+ }
112
+ }
113
+ ]
114
+ }
115
+ ) {
116
+ cart {
117
+ items {
118
+ qty
119
+ }
120
+ }
121
+ }
122
+ }
84
123
QUERY ;
85
124
86
125
$ this ->graphQlQuery ($ query );
You can’t perform that action at this time.
0 commit comments