mirror of
https://github.com/retailcrm/graphql-php.git
synced 2025-02-06 07:49:24 +03:00
Add a unit test covering the operationName parsing
This commit is contained in:
parent
8aa6dc17a5
commit
68eb325d18
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user