From 68eb325d1894fdf0e02f51cc7bf95bd5c09678bd Mon Sep 17 00:00:00 2001 From: Chris Muthig Date: Wed, 28 Mar 2018 13:55:59 -0700 Subject: [PATCH] Add a unit test covering the operationName parsing --- tests/Server/StandardServerTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/Server/StandardServerTest.php b/tests/Server/StandardServerTest.php index 5a1246d..cc4adff 100644 --- a/tests/Server/StandardServerTest.php +++ b/tests/Server/StandardServerTest.php @@ -57,6 +57,23 @@ class StandardServerTest extends TestCase $this->assertPsrRequestEquals($expected, $request); } + public function testMultipleOperationPsrRequestExecution() + { + $body = [ + 'query' => 'query firstOp {fieldWithPhpError} query secondOp {f1}', + 'operationName' => 'secondOp' + ]; + + $expected = [ + 'data' => [ + 'f1' => 'f1' + ] + ]; + + $request = $this->preparePsrRequest('application/json', $body); + $this->assertPsrRequestEquals($expected, $request); + } + private function executePsrRequest($psrRequest) { $server = new StandardServer($this->config);