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

testSimpleUnion() public method

public testSimpleUnion ( )
    public function testSimpleUnion()
    {
        $body = 'union Hello = World';
        $doc = Parser::parse($body);
        $loc = function ($start, $end) {
            return TestUtils::locArray($start, $end);
        };
        $expected = ['kind' => NodeKind::DOCUMENT, 'definitions' => [['kind' => NodeKind::UNION_TYPE_DEFINITION, 'name' => $this->nameNode('Hello', $loc(6, 11)), 'directives' => [], 'types' => [$this->typeNode('World', $loc(14, 19))], 'loc' => $loc(0, 19)]], 'loc' => $loc(0, 19)];
        $this->assertEquals($expected, TestUtils::nodeToArray($doc));
    }