Add a unit test covering the operationName parsing

This commit is contained in:
Chris Muthig 2018-03-28 13:55:59 -07:00
parent 8aa6dc17a5
commit 68eb325d18
No known key found for this signature in database
GPG Key ID: 28E4EB85B5AB189A

View File

@ -57,6 +57,23 @@ class StandardServerTest extends TestCase
$this->assertPsrRequestEquals($expected, $request); $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) private function executePsrRequest($psrRequest)
{ {
$server = new StandardServer($this->config); $server = new StandardServer($this->config);