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

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

    public function testSimpleFieldWithListArg()
    {
        $body = '
type Hello {
  world(things: [String]): 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->fieldNodeWithArgs($this->nameNode('world', $loc(16, 21)), $this->typeNode('String', $loc(41, 47)), [$this->inputValueNode($this->nameNode('things', $loc(22, 28)), ['kind' => NodeKind::LIST_TYPE, 'type' => $this->typeNode('String', $loc(31, 37)), 'loc' => $loc(30, 38)], null, $loc(22, 38))], $loc(16, 47))], 'loc' => $loc(1, 49)]], 'loc' => $loc(0, 49)];
        $this->assertEquals($expected, TestUtils::nodeToArray($doc));
    }