private function check($testType, $testData, $expected)
{
$data = ['test' => $testData];
$dataType = null;
$dataType = new ObjectType(['name' => 'DataType', 'fields' => function () use(&$testType, &$dataType, $data) {
return ['test' => ['type' => $testType], 'nest' => ['type' => $dataType, 'resolve' => function () use($data) {
return $data;
}]];
}]);
$schema = new Schema(['query' => $dataType]);
$ast = Parser::parse('{ nest { test } }');
$result = Executor::execute($schema, $ast, $data);
$this->assertArraySubset($expected, self::awaitPromise($result));
}