GraphQL\Tests\Language\SchemaParserTest::testSimpleInterface PHP Method

testSimpleInterface() public method

public testSimpleInterface ( )
    public function testSimpleInterface()
    {
        $body = '
interface Hello {
  world: String
}';
        $doc = Parser::parse($body);
        $loc = function ($start, $end) {
            return TestUtils::locArray($start, $end);
        };
        $expected = ['kind' => NodeKind::DOCUMENT, 'definitions' => [['kind' => NodeKind::INTERFACE_TYPE_DEFINITION, 'name' => $this->nameNode('Hello', $loc(11, 16)), 'directives' => [], 'fields' => [$this->fieldNode($this->nameNode('world', $loc(21, 26)), $this->typeNode('String', $loc(28, 34)), $loc(21, 34))], 'loc' => $loc(1, 36)]], 'loc' => $loc(0, 36)];
        $this->assertEquals($expected, TestUtils::nodeToArray($doc));
    }