@@ -242,13 +242,16 @@ public function testLoginQuery(): void
242242 $ container = $ kernel ->getContainer ();
243243 $ container ->set ('session ' , $ session );
244244
245- $ request = Request::create ('/graphql ' , 'POST ' , ['query ' => '
246- mutation login {
247- login(userName: "foo", password: "bar") {
248- userName
249- roles
250- }
251- } ' ]);
245+ $ parameters = ['query ' => '
246+ mutation login {
247+ login(userName: "foo", password: "bar") {
248+ userName
249+ roles
250+ }
251+ }
252+ ' ];
253+
254+ $ request = Request::create ('/graphql ' , 'POST ' , $ parameters , [], [], ['CONTENT_TYPE ' => 'application/json ' ]);
252255
253256 $ response = $ kernel ->handle ($ request );
254257
@@ -275,14 +278,16 @@ public function testMeQuery(): void
275278 $ container = $ kernel ->getContainer ();
276279 $ container ->set ('session ' , $ session );
277280
278- $ request = Request::create ('/graphql ' , 'POST ' , ['query ' => '
279- {
280- me {
281- userName
282- roles
283- }
284- }
285- ' ]);
281+ $ parameters = ['query ' => '
282+ {
283+ me {
284+ userName
285+ roles
286+ }
287+ }
288+ ' ];
289+
290+ $ request = Request::create ('/graphql ' , 'POST ' , $ parameters , [], [], ['CONTENT_TYPE ' => 'application/json ' ]);
286291
287292 $ response = $ kernel ->handle ($ request );
288293
@@ -301,12 +306,15 @@ public function testNoLoginNoSessionQuery(): void
301306 $ kernel = new GraphqliteTestingKernel (false , 'off ' );
302307 $ kernel ->boot ();
303308
304- $ request = Request::create ('/graphql ' , 'POST ' , ['query ' => '
305- mutation login {
306- login(userName: "foo", password: "bar") {
307- userName
308- }
309- } ' ]);
309+ $ parameters = ['query ' => '
310+ mutation login {
311+ login(userName: "foo", password: "bar") {
312+ userName
313+ }
314+ }
315+ ' ];
316+
317+ $ request = Request::create ('/graphql ' , 'POST ' , $ parameters , [], [], ['CONTENT_TYPE ' => 'application/json ' ]);
310318
311319 $ response = $ kernel ->handle ($ request );
312320
@@ -381,14 +389,16 @@ public function testAllOff(): void
381389 $ container = $ kernel ->getContainer ();
382390 $ container ->set ('session ' , $ session );
383391
384- $ request = Request::create ('/graphql ' , 'POST ' , ['query ' => '
385- {
386- me {
387- userName
388- roles
389- }
390- }
391- ' ]);
392+ $ parameters = ['query ' => '
393+ {
394+ me {
395+ userName
396+ roles
397+ }
398+ }
399+ ' ];
400+
401+ $ request = Request::create ('/graphql ' , 'POST ' , $ parameters , [], [], ['CONTENT_TYPE ' => 'application/json ' ]);
392402
393403 $ response = $ kernel ->handle ($ request );
394404
@@ -406,11 +416,13 @@ public function testValidation(): void
406416 $ container = $ kernel ->getContainer ();
407417 $ container ->set ('session ' , $ session );
408418
409- $ request = Request::create ('/graphql ' , 'POST ' , ['query ' => '
410- {
411- findByMail(email: "notvalid")
412- }
413- ' ]);
419+ $ parameters = ['query ' => '
420+ {
421+ findByMail(email: "notvalid")
422+ }
423+ ' ];
424+
425+ $ request = Request::create ('/graphql ' , 'POST ' , $ parameters , [], [], ['CONTENT_TYPE ' => 'application/json ' ]);
414426
415427 $ response = $ kernel ->handle ($ request );
416428
@@ -427,15 +439,17 @@ public function testWithIntrospection(): void
427439 $ kernel = new GraphqliteTestingKernel (true , null , true , null );
428440 $ kernel ->boot ();
429441
430- $ request = Request::create ('/graphql ' , 'POST ' , ['query ' => '
431- {
432- __schema {
433- queryType {
434- name
442+ $ parameters = ['query ' => '
443+ {
444+ __schema {
445+ queryType {
446+ name
447+ }
448+ }
435449 }
436- }
437- }
438- ' ]);
450+ ' ];
451+
452+ $ request = Request:: create ( ' /graphql ' , ' POST ' , $ parameters , [], [], [ ' CONTENT_TYPE ' => ' application/json ' ]);
439453
440454 $ response = $ kernel ->handle ($ request );
441455
@@ -450,15 +464,17 @@ public function testDisableIntrospection(): void
450464 $ kernel = new GraphqliteTestingKernel (true , null , true , null , false , 2 , 2 );
451465 $ kernel ->boot ();
452466
453- $ request = Request::create ('/graphql ' , 'POST ' , ['query ' => '
454- {
455- __schema {
456- queryType {
457- name
467+ $ parameters = ['query ' => '
468+ {
469+ __schema {
470+ queryType {
471+ name
472+ }
473+ }
458474 }
459- }
460- }
461- ' ]);
475+ ' ];
476+
477+ $ request = Request:: create ( ' /graphql ' , ' POST ' , $ parameters , [], [], [ ' CONTENT_TYPE ' => ' application/json ' ]);
462478
463479 $ response = $ kernel ->handle ($ request );
464480
@@ -473,18 +489,20 @@ public function testMaxQueryComplexity(): void
473489 $ kernel = new GraphqliteTestingKernel (true , null , true , null , false , 2 , null );
474490 $ kernel ->boot ();
475491
476- $ request = Request::create ('/graphql ' , 'POST ' , ['query ' => '
477- {
478- products
479- {
480- name,
481- price,
482- seller {
483- name
492+ $ parameters = ['query ' => '
493+ {
494+ products
495+ {
496+ name,
497+ price,
498+ seller {
499+ name
500+ }
501+ }
484502 }
485- }
486- }
487- ' ]);
503+ ' ];
504+
505+ $ request = Request:: create ( ' /graphql ' , ' POST ' , $ parameters , [], [], [ ' CONTENT_TYPE ' => ' application/json ' ]);
488506
489507 $ response = $ kernel ->handle ($ request );
490508
@@ -499,24 +517,26 @@ public function testMaxQueryDepth(): void
499517 $ kernel = new GraphqliteTestingKernel (true , null , true , null , false , null , 1 );
500518 $ kernel ->boot ();
501519
502- $ request = Request::create ('/graphql ' , 'POST ' , ['query ' => '
503- {
504- products
505- {
506- name,
507- price,
508- seller {
509- name
510- manager {
511- name
512- manager {
520+ $ parameters = ['query ' => '
521+ {
522+ products
523+ {
524+ name,
525+ price,
526+ seller {
513527 name
528+ manager {
529+ name
530+ manager {
531+ name
532+ }
533+ }
514534 }
515535 }
516536 }
517- }
518- }
519- ' ]);
537+ ' ];
538+
539+ $ request = Request:: create ( ' /graphql ' , ' POST ' , $ parameters , [], [], [ ' CONTENT_TYPE ' => ' application/json ' ]);
520540
521541 $ response = $ kernel ->handle ($ request );
522542
0 commit comments