Skip to content

Commit 5ac9d3b

Browse files
committed
229: [GraphQL caching] Add support for queries via HTTP GET
- Fix static tests
1 parent d443e55 commit 5ac9d3b

File tree

5 files changed

+16
-11
lines changed

5 files changed

+16
-11
lines changed

dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQl/Client.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,14 @@ private function processResponse(string $response)
101101
$responseArray = $this->json->jsonDecode($response);
102102

103103
if (!is_array($responseArray)) {
104+
//phpcs:ignore Magento2.Exceptions.DirectThrow
104105
throw new \Exception('Unknown GraphQL response body: ' . $response);
105106
}
106107

107108
$this->processErrors($responseArray);
108109

109110
if (!isset($responseArray['data'])) {
111+
//phpcs:ignore Magento2.Exceptions.DirectThrow
110112
throw new \Exception('Unknown GraphQL response body: ' . $response);
111113
}
112114

@@ -142,6 +144,7 @@ private function processErrors($responseBodyArray)
142144
$responseBodyArray
143145
);
144146
}
147+
//phpcs:ignore Magento2.Exceptions.DirectThrow
145148
throw new \Exception('GraphQL responded with an unknown error: ' . json_encode($responseBodyArray));
146149
}
147150
}

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,12 @@ public function testUpdateCustomer()
8787
}
8888
}
8989
QUERY;
90-
$response = $this->graphQlMutation($query, [], '', $this->getCustomerAuthHeaders($currentEmail, $currentPassword));
90+
$response = $this->graphQlMutation(
91+
$query,
92+
[],
93+
'',
94+
$this->getCustomerAuthHeaders($currentEmail, $currentPassword)
95+
);
9196

9297
$this->assertEquals($newPrefix, $response['updateCustomer']['customer']['prefix']);
9398
$this->assertEquals($newFirstname, $response['updateCustomer']['customer']['firstname']);

dev/tests/api-functional/testsuite/Magento/GraphQl/TestModule/GraphQlMutationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ public function testMutationIsNotAllowedViaGetRequest()
5353
}
5454
MUTATION;
5555

56-
$this->graphQlQuery($query, [], '', [], 'GET');
56+
$this->graphQlQuery($query, [], '', []);
5757
}
5858
}

dev/tests/api-functional/testsuite/Magento/GraphQl/Vault/CustomerPaymentTokensTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,12 @@ public function testDeletePaymentToken()
139139
}
140140
}
141141
QUERY;
142-
$response = $this->graphQlMutation($query, [], '', $this->getCustomerAuthHeaders($currentEmail, $currentPassword));
142+
$response = $this->graphQlMutation(
143+
$query,
144+
[],
145+
'',
146+
$this->getCustomerAuthHeaders($currentEmail, $currentPassword)
147+
);
143148

144149
$this->assertTrue($response['deletePaymentToken']['result']);
145150
$this->assertEquals(1, count($response['deletePaymentToken']['customerPaymentTokens']['items']));

dev/tests/integration/testsuite/Magento/GraphQl/Controller/GraphQlControllerTest.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -265,12 +265,4 @@ public function testError() : void
265265
}
266266
}
267267
}
268-
269-
/**
270-
* teardown
271-
*/
272-
public function tearDown()
273-
{
274-
parent::tearDown();
275-
}
276268
}

0 commit comments

Comments
 (0)