Skip to content

Commit 288dec3

Browse files
committed
229: [GraphQL caching] Add support for queries via HTTP GET
1 parent c6cebfc commit 288dec3

20 files changed

+78
-47
lines changed

dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/AddProductToCartTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
use Magento\Quote\Model\QuoteIdToMaskedQuoteIdInterface;
1414
use Magento\Quote\Model\ResourceModel\Quote as QuoteResource;
1515

16+
/**
17+
* Test for adding products to cart
18+
*/
1619
class AddProductToCartTest extends GraphQlAbstract
1720
{
1821
/**

dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/ChangeCustomerPasswordTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
use Magento\TestFramework\Helper\Bootstrap;
1515
use Magento\TestFramework\TestCase\GraphQlAbstract;
1616

17+
/**
18+
* Test change customer password
19+
*/
1720
class ChangeCustomerPasswordTest extends GraphQlAbstract
1821
{
1922
/**

dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerAddressTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ public function testCreateCustomerAddressWithRedundantStreetLine()
264264
$password = 'password';
265265

266266
self::expectExceptionMessage('"Street Address" cannot contain more than 2 lines.');
267-
$this->graphQlQuery($mutation, [], '', $this->getCustomerAuthHeaders($userName, $password));
267+
$this->graphQlMutation($mutation, [], '', $this->getCustomerAuthHeaders($userName, $password));
268268
}
269269

270270
/**

dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/DeleteCustomerAddressTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
use Magento\TestFramework\TestCase\GraphQlAbstract;
1414
use Magento\Integration\Api\CustomerTokenServiceInterface;
1515

16+
/**
17+
* Delete customer address tests
18+
*/
1619
class DeleteCustomerAddressTest extends GraphQlAbstract
1720
{
1821
/**

dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/SubscriptionStatusTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
use Magento\TestFramework\Helper\Bootstrap;
1313
use Magento\TestFramework\TestCase\GraphQlAbstract;
1414

15+
/**
16+
* Tests for subscription status
17+
*/
1518
class SubscriptionStatusTest extends GraphQlAbstract
1619
{
1720
/**

dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/UpdateCustomerAddressTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
use Magento\TestFramework\TestCase\GraphQlAbstract;
1515
use Magento\Integration\Api\CustomerTokenServiceInterface;
1616

17+
/**
18+
* Update customer address tests
19+
*/
1720
class UpdateCustomerAddressTest extends GraphQlAbstract
1821
{
1922
/**

dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/UpdateCustomerTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
use Magento\TestFramework\Helper\Bootstrap;
1414
use Magento\TestFramework\TestCase\GraphQlAbstract;
1515

16+
/**
17+
* Tests for update customer
18+
*/
1619
class UpdateCustomerTest extends GraphQlAbstract
1720
{
1821
/**

dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddConfigurableProductToCartTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
use Magento\Quote\Model\QuoteIdToMaskedQuoteIdInterface;
1414
use Magento\Quote\Model\ResourceModel\Quote as QuoteResource;
1515

16+
/**
17+
* Add configurable product to cart tests
18+
*/
1619
class AddConfigurableProductToCartTest extends GraphQlAbstract
1720
{
1821
/**

dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddSimpleProductToCartTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
use Magento\Quote\Model\QuoteIdToMaskedQuoteIdInterface;
1414
use Magento\Quote\Model\ResourceModel\Quote as QuoteResource;
1515

16+
/**
17+
* Add simple product to cart tests
18+
*/
1619
class AddSimpleProductToCartTest extends GraphQlAbstract
1720
{
1821
/**

dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/ApplyCouponToCartTest.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function testApplyCouponToCart()
4747
$couponCode = '2?ds5!2d';
4848
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
4949
$query = $this->getQuery($maskedQuoteId, $couponCode);
50-
$response = $this->graphQlQuery($query, [], '', $this->getHeaderMap());
50+
$response = $this->graphQlMutation($query, [], '', $this->getHeaderMap());
5151

5252
self::assertArrayHasKey('applyCouponToCart', $response);
5353
self::assertEquals($couponCode, $response['applyCouponToCart']['cart']['applied_coupon']['code']);
@@ -67,12 +67,12 @@ public function testApplyCouponTwice()
6767
$couponCode = '2?ds5!2d';
6868
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
6969
$query = $this->getQuery($maskedQuoteId, $couponCode);
70-
$response = $this->graphQlQuery($query, [], '', $this->getHeaderMap());
70+
$response = $this->graphQlMutation($query, [], '', $this->getHeaderMap());
7171

7272
self::assertArrayHasKey("applyCouponToCart", $response);
7373
self::assertEquals($couponCode, $response['applyCouponToCart']['cart']['applied_coupon']['code']);
7474

75-
$this->graphQlQuery($query, [], '', $this->getHeaderMap());
75+
$this->graphQlMutation($query, [], '', $this->getHeaderMap());
7676
}
7777

7878
/**
@@ -89,7 +89,7 @@ public function testApplyCouponToCartWithoutItems()
8989
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
9090
$query = $this->getQuery($maskedQuoteId, $couponCode);
9191

92-
$this->graphQlQuery($query, [], '', $this->getHeaderMap());
92+
$this->graphQlMutation($query, [], '', $this->getHeaderMap());
9393
}
9494

9595
/**
@@ -106,7 +106,7 @@ public function testApplyCouponToGuestCart()
106106
$query = $this->getQuery($maskedQuoteId, $couponCode);
107107

108108
self::expectExceptionMessage('The current user cannot perform operations on cart "' . $maskedQuoteId . '"');
109-
$this->graphQlQuery($query, [], '', $this->getHeaderMap());
109+
$this->graphQlMutation($query, [], '', $this->getHeaderMap());
110110
}
111111

112112
/**
@@ -125,7 +125,7 @@ public function testApplyCouponToAnotherCustomerCart()
125125
$query = $this->getQuery($maskedQuoteId, $couponCode);
126126

127127
self::expectExceptionMessage('The current user cannot perform operations on cart "' . $maskedQuoteId . '"');
128-
$this->graphQlQuery($query, [], '', $this->getHeaderMap('customer_two@example.com'));
128+
$this->graphQlMutation($query, [], '', $this->getHeaderMap('customer_two@example.com'));
129129
}
130130

131131
/**
@@ -142,7 +142,7 @@ public function testApplyNonExistentCouponToCart()
142142
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
143143
$query = $this->getQuery($maskedQuoteId, $couponCode);
144144

145-
$this->graphQlQuery($query, [], '', $this->getHeaderMap());
145+
$this->graphQlMutation($query, [], '', $this->getHeaderMap());
146146
}
147147

148148
/**
@@ -159,7 +159,7 @@ public function testApplyCouponToNonExistentCart()
159159
$query = $this->getQuery($maskedQuoteId, $couponCode);
160160

161161
self::expectExceptionMessage('Could not find a cart with ID "' . $maskedQuoteId . '"');
162-
$this->graphQlQuery($query, [], '', $this->getHeaderMap());
162+
$this->graphQlMutation($query, [], '', $this->getHeaderMap());
163163
}
164164

165165
/**
@@ -179,7 +179,7 @@ public function testApplyExpiredCoupon()
179179
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
180180
$query = $this->getQuery($maskedQuoteId, $couponCode);
181181

182-
$this->graphQlQuery($query, [], '', $this->getHeaderMap());
182+
$this->graphQlMutation($query, [], '', $this->getHeaderMap());
183183
}
184184

185185
/**
@@ -200,7 +200,7 @@ public function testApplyCouponWhichIsNotApplicable()
200200
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
201201
$query = $this->getQuery($maskedQuoteId, $couponCode);
202202

203-
$this->graphQlQuery($query, [], '', $this->getHeaderMap());
203+
$this->graphQlMutation($query, [], '', $this->getHeaderMap());
204204
}
205205

206206
/**
@@ -226,7 +226,7 @@ public function testApplyCouponWithMissedRequiredParameters(string $input, strin
226226
QUERY;
227227

228228
$this->expectExceptionMessage($message);
229-
$this->graphQlQuery($query, [], '', $this->getHeaderMap());
229+
$this->graphQlMutation($query, [], '', $this->getHeaderMap());
230230
}
231231

232232
/**

0 commit comments

Comments
 (0)