GraphQL\Tests\Type\IntrospectionTest::testFailsAsExpectedOnThe__typeRootFieldWithoutAnArg PHP Method

testFailsAsExpectedOnThe__typeRootFieldWithoutAnArg() public method

    public function testFailsAsExpectedOnThe__typeRootFieldWithoutAnArg()
    {
        $TestType = new ObjectType(['name' => 'TestType', 'fields' => ['testField' => ['type' => Type::string()]]]);
        $schema = new Schema(['query' => $TestType]);
        $request = '
      {
        __type {
          name
        }
      }
    ';
        $expected = ['errors' => [FormattedError::create(ProvidedNonNullArguments::missingFieldArgMessage('__type', 'name', 'String!'), [new SourceLocation(3, 9)])]];
        $this->assertEquals($expected, GraphQL::execute($schema, $request));
    }