GraphQL\Tests\Type\DefinitionTest::testIncludesInterfaceSubtypesInTheTypeMap PHP Method

testIncludesInterfaceSubtypesInTheTypeMap() public method

    public function testIncludesInterfaceSubtypesInTheTypeMap()
    {
        $someInterface = new InterfaceType(['name' => 'SomeInterface', 'fields' => ['f' => ['type' => Type::int()]]]);
        $someSubtype = new ObjectType(['name' => 'SomeSubtype', 'fields' => ['f' => ['type' => Type::int()]], 'interfaces' => [$someInterface], 'isTypeOf' => function () {
            return true;
        }]);
        $schema = new Schema(['query' => new ObjectType(['name' => 'Query', 'fields' => ['iface' => ['type' => $someInterface]]]), 'types' => [$someSubtype]]);
        $this->assertSame($someSubtype, $schema->getType('SomeSubtype'));
    }