Skip to content

Commit 01e6312

Browse files
committed
Fixing existing API-functional tests
1 parent 85fd270 commit 01e6312

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/AddBundleProductToCartSingleMutationTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class AddBundleProductToCartSingleMutationTest extends GraphQlAbstract
4242
/**
4343
* @inheritdoc
4444
*/
45-
protected function setUp()
45+
protected function setUp(): void
4646
{
4747
$objectManager = Bootstrap::getObjectManager();
4848
$this->quoteResource = $objectManager->get(QuoteResource::class);
@@ -83,8 +83,8 @@ public function testAddBundleProductToCart()
8383
$query = <<<QUERY
8484
mutation {
8585
addProductsToCart(
86-
cart_id: "{$maskedQuoteId}",
87-
cart_items: [
86+
cartId: "{$maskedQuoteId}",
87+
cartItems: [
8888
{
8989
sku: "{$sku}"
9090
quantity: 1
@@ -175,8 +175,8 @@ public function testAddBundleToCartWithWrongBundleOptions()
175175
$query = <<<QUERY
176176
mutation {
177177
addProductsToCart(
178-
cart_id: "{$maskedQuoteId}",
179-
cart_items: [
178+
cartId: "{$maskedQuoteId}",
179+
cartItems: [
180180
{
181181
sku: "bundle-product"
182182
quantity: 1

dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartSingleMutationTest.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class AddConfigurableProductToCartSingleMutationTest extends GraphQlAbstract
2525
/**
2626
* @inheritdoc
2727
*/
28-
protected function setUp()
28+
protected function setUp(): void
2929
{
3030
$objectManager = Bootstrap::getObjectManager();
3131
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -131,7 +131,7 @@ public function testAddProductIfQuantityIsNotAvailable()
131131
$response = $this->graphQlMutation($query);
132132

133133
self::assertEquals(
134-
'Could not add the product with SKU configurable to the shopping cart: The requested qty is not available',
134+
'The requested qty is not available',
135135
$response['addProductsToCart']['userInputErrors'][0]['message']
136136
);
137137
}
@@ -183,8 +183,7 @@ public function testOutOfStockVariationToCart()
183183

184184
$response = $this->graphQlMutation($query);
185185

186-
$expectedErrorMessage = 'Could not add the product with SKU configurable to the shopping cart: ' .
187-
'There are no source items with the in stock status';
186+
$expectedErrorMessage = 'This product is out of stock.';
188187
self::assertEquals($expectedErrorMessage, $response['addProductsToCart']['userInputErrors'][0]['message']);
189188
}
190189

@@ -204,8 +203,8 @@ private function getQuery(
204203
return <<<QUERY
205204
mutation {
206205
addProductsToCart(
207-
cart_id:"{$maskedQuoteId}"
208-
cart_items: [
206+
cartId:"{$maskedQuoteId}"
207+
cartItems: [
209208
{
210209
sku: "{$parentSku}"
211210
quantity: $quantity

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class AddDownloadableProductToCartSingleMutationTest extends GraphQlAbstract
3535
/**
3636
* @inheritdoc
3737
*/
38-
protected function setUp()
38+
protected function setUp(): void
3939
{
4040
$this->objectManager = Bootstrap::getObjectManager();
4141
$this->getMaskedQuoteIdByReservedOrderId = $this->objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
@@ -175,8 +175,8 @@ private function getQuery(
175175
return <<<MUTATION
176176
mutation {
177177
addProductsToCart(
178-
cart_id: "{$maskedQuoteId}",
179-
cart_items: [
178+
cartId: "{$maskedQuoteId}",
179+
cartItems: [
180180
{
181181
sku: "{$sku}"
182182
quantity: {$qty}

0 commit comments

Comments
 (0)