GraphQL\Tests\Type\SchemaValidatorTest::testRejectsSchemaWhichHaveSameNamedObjectsImplementingInterface PHP Метод

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

    public function testRejectsSchemaWhichHaveSameNamedObjectsImplementingInterface()
    {
        $AnotherInterface = new InterfaceType(['name' => 'AnotherInterface', 'resolveType' => function () {
            return null;
        }, 'fields' => ['f' => ['type' => Type::string()]]]);
        $FirstBadObject = new ObjectType(['name' => 'BadObject', 'interfaces' => [$AnotherInterface], 'fields' => ['f' => ['type' => Type::string()]]]);
        $SecondBadObject = new ObjectType(['name' => 'BadObject', 'interfaces' => [$AnotherInterface], 'fields' => ['f' => ['type' => Type::string()]]]);
        $QueryType = new ObjectType(['name' => 'Query', 'fields' => ['iface' => ['type' => $AnotherInterface]]]);
        $this->expectFails(['query' => $QueryType, 'types' => [$FirstBadObject, $SecondBadObject]], 'Schema must contain unique named types but contains multiple types named "BadObject".');
    }
SchemaValidatorTest