@@ -58,7 +58,7 @@ public function testGetHtmlAction(): void
58
58
59
59
public function testGetAction (): void
60
60
{
61
- $ request = new Request (['query ' => 'graphqlQuery ' , 'variables ' => '["graphqlVariable"] ' , 'operation ' => 'graphqlOperationName ' ]);
61
+ $ request = new Request (['query ' => 'graphqlQuery ' , 'variables ' => '["graphqlVariable"] ' , 'operationName ' => 'graphqlOperationName ' ]);
62
62
$ request ->setRequestFormat ('json ' );
63
63
$ mockedEntrypoint = $ this ->getEntrypointAction ();
64
64
@@ -67,7 +67,7 @@ public function testGetAction(): void
67
67
68
68
public function testPostRawAction (): void
69
69
{
70
- $ request = new Request (['variables ' => '["graphqlVariable"] ' , 'operation ' => 'graphqlOperationName ' ], [], [], [], [], [], 'graphqlQuery ' );
70
+ $ request = new Request (['variables ' => '["graphqlVariable"] ' , 'operationName ' => 'graphqlOperationName ' ], [], [], [], [], [], 'graphqlQuery ' );
71
71
$ request ->setFormat ('graphql ' , 'application/graphql ' );
72
72
$ request ->setMethod ('POST ' );
73
73
$ request ->headers ->set ('Content-Type ' , 'application/graphql ' );
@@ -78,7 +78,7 @@ public function testPostRawAction(): void
78
78
79
79
public function testPostJsonAction (): void
80
80
{
81
- $ request = new Request ([], [], [], [], [], [], '{"query": "graphqlQuery", "variables": "[\"graphqlVariable\"]", "operation ": "graphqlOperationName"} ' );
81
+ $ request = new Request ([], [], [], [], [], [], '{"query": "graphqlQuery", "variables": "[\"graphqlVariable\"]", "operationName ": "graphqlOperationName"} ' );
82
82
$ request ->setMethod ('POST ' );
83
83
$ request ->headers ->set ('Content-Type ' , 'application/json ' );
84
84
$ mockedEntrypoint = $ this ->getEntrypointAction ();
@@ -119,14 +119,14 @@ public function multipartRequestProvider(): array
119
119
120
120
return [
121
121
'upload a single file ' => [
122
- '{"query": "graphqlQuery", "variables": {"file": null}, "operation ": "graphqlOperationName"} ' ,
122
+ '{"query": "graphqlQuery", "variables": {"file": null}, "operationName ": "graphqlOperationName"} ' ,
123
123
'{"file": ["variables.file"]} ' ,
124
124
['file ' => $ file ],
125
125
['file ' => $ file ],
126
126
new JsonResponse (['GraphQL ' ]),
127
127
],
128
128
'upload multiple files ' => [
129
- '{"query": "graphqlQuery", "variables": {"files": [null, null, null]}, "operation ": "graphqlOperationName"} ' ,
129
+ '{"query": "graphqlQuery", "variables": {"files": [null, null, null]}, "operationName ": "graphqlOperationName"} ' ,
130
130
'{"0": ["variables.files.0"], "1": ["variables.files.1"], "2": ["variables.files.2"]} ' ,
131
131
[
132
132
'0 ' => $ file ,
@@ -150,7 +150,7 @@ public function multipartRequestProvider(): array
150
150
new Response ('{"errors":[{"message":"GraphQL multipart request does not respect the specification.","extensions":{"category":"user","status":400}}]} ' ),
151
151
],
152
152
'upload without providing map ' => [
153
- '{"query": "graphqlQuery", "variables": {"file": null}, "operation ": "graphqlOperationName"} ' ,
153
+ '{"query": "graphqlQuery", "variables": {"file": null}, "operationName ": "graphqlOperationName"} ' ,
154
154
null ,
155
155
['file ' => $ file ],
156
156
['file ' => null ],
@@ -164,28 +164,28 @@ public function multipartRequestProvider(): array
164
164
new Response ('{"errors":[{"message":"GraphQL data is not valid JSON.","extensions":{"category":"user","status":400}}]} ' ),
165
165
],
166
166
'upload with invalid map JSON ' => [
167
- '{"query": "graphqlQuery", "variables": {"file": null}, "operation ": "graphqlOperationName"} ' ,
167
+ '{"query": "graphqlQuery", "variables": {"file": null}, "operationName ": "graphqlOperationName"} ' ,
168
168
'{invalid} ' ,
169
169
['file ' => $ file ],
170
170
['file ' => null ],
171
171
new Response ('{"errors":[{"message":"GraphQL multipart request map is not valid JSON.","extensions":{"category":"user","status":400}}]} ' ),
172
172
],
173
173
'upload with no file ' => [
174
- '{"query": "graphqlQuery", "variables": {"file": null}, "operation ": "graphqlOperationName"} ' ,
174
+ '{"query": "graphqlQuery", "variables": {"file": null}, "operationName ": "graphqlOperationName"} ' ,
175
175
'{"file": ["file"]} ' ,
176
176
[],
177
177
['file ' => null ],
178
178
new Response ('{"errors":[{"message":"GraphQL multipart request file has not been sent correctly.","extensions":{"category":"user","status":400}}]} ' ),
179
179
],
180
180
'upload with wrong map ' => [
181
- '{"query": "graphqlQuery", "variables": {"file": null}, "operation ": "graphqlOperationName"} ' ,
181
+ '{"query": "graphqlQuery", "variables": {"file": null}, "operationName ": "graphqlOperationName"} ' ,
182
182
'{"file": ["file"]} ' ,
183
183
['file ' => $ file ],
184
184
['file ' => null ],
185
185
new Response ('{"errors":[{"message":"GraphQL multipart request path in map is invalid.","extensions":{"category":"user","status":400}}]} ' ),
186
186
],
187
187
'upload when variable path does not exist ' => [
188
- '{"query": "graphqlQuery", "variables": {"file": null}, "operation ": "graphqlOperationName"} ' ,
188
+ '{"query": "graphqlQuery", "variables": {"file": null}, "operationName ": "graphqlOperationName"} ' ,
189
189
'{"file": ["variables.wrong"]} ' ,
190
190
['file ' => $ file ],
191
191
['file ' => null ],
@@ -217,7 +217,7 @@ public function testBadMethodAction(): void
217
217
218
218
public function testBadVariablesAction (): void
219
219
{
220
- $ request = new Request (['query ' => 'graphqlQuery ' , 'variables ' => 'graphqlVariable ' , 'operation ' => 'graphqlOperationName ' ]);
220
+ $ request = new Request (['query ' => 'graphqlQuery ' , 'variables ' => 'graphqlVariable ' , 'operationName ' => 'graphqlOperationName ' ]);
221
221
$ request ->setRequestFormat ('json ' );
222
222
$ mockedEntrypoint = $ this ->getEntrypointAction ();
223
223
0 commit comments