GraphQL\Tests\Language\SchemaParserTest::testUnionWithTwoTypes PHP Метод

testUnionWithTwoTypes() публичный Метод

    public function testUnionWithTwoTypes()
    {
        $body = 'union Hello = Wo | Rld';
        $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('Wo', $loc(14, 16)), $this->typeNode('Rld', $loc(19, 22))], 'loc' => $loc(0, 22)]], 'loc' => $loc(0, 22)];
        $this->assertEquals($expected, TestUtils::nodeToArray($doc));
    }