public function testSimpleType()
{
$body = '
type Hello {
world: String
}';
$doc = Parser::parse($body);
$loc = function ($start, $end) {
return TestUtils::locArray($start, $end);
};
$expected = ['kind' => NodeKind::DOCUMENT, 'definitions' => [['kind' => NodeKind::OBJECT_TYPE_DEFINITION, 'name' => $this->nameNode('Hello', $loc(6, 11)), 'interfaces' => [], 'directives' => [], 'fields' => [$this->fieldNode($this->nameNode('world', $loc(16, 21)), $this->typeNode('String', $loc(23, 29)), $loc(16, 29))], 'loc' => $loc(1, 31)]], 'loc' => $loc(0, 31)];
$this->assertEquals($expected, TestUtils::nodeToArray($doc));
}