public function testPredefinedQueries($query, $expectedResponse)
{
$schema = new TestEmptySchema();
$schema->addQueryField(new Field(['name' => 'latest', 'type' => new ObjectType(['name' => 'LatestType', 'fields' => ['id' => ['type' => TypeMap::TYPE_INT], 'name' => ['type' => TypeMap::TYPE_STRING]]]), 'args' => ['id' => ['type' => TypeMap::TYPE_INT, 'default' => 'test'], 'id2' => ['type' => TypeMap::TYPE_INT]], 'description' => 'latest description', 'deprecationReason' => 'for test', 'isDeprecated' => true, 'resolve' => function () {
return ['id' => 1, 'name' => 'Alex'];
}]));
$processor = new Processor($schema);
$processor->processPayload($query);
$responseData = $processor->getResponseData();
$this->assertEquals($expectedResponse, $responseData);
}