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

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

    public function testSimpleFieldWithArg()
    {
        $body = '
type Hello {
  world(flag: Boolean): 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(38, 44)), [$this->inputValueNode($this->nameNode('flag', $loc(22, 26)), $this->typeNode('Boolean', $loc(28, 35)), null, $loc(22, 35))], $loc(16, 44))], 'loc' => $loc(1, 46)]], 'loc' => $loc(0, 46)];
        $this->assertEquals($expected, TestUtils::nodeToArray($doc));
    }