GraphQL\Tests\Type\DefinitionTest::testDefinesAnObjectTypeWithDeprecatedField PHP Méthode

testDefinesAnObjectTypeWithDeprecatedField() public méthode

    public function testDefinesAnObjectTypeWithDeprecatedField()
    {
        $TypeWithDeprecatedField = new ObjectType(['name' => 'foo', 'fields' => ['bar' => ['type' => Type::string(), 'deprecationReason' => 'A terrible reason']]]);
        $field = $TypeWithDeprecatedField->getField('bar');
        $this->assertEquals(Type::string(), $field->getType());
        $this->assertEquals(true, $field->isDeprecated());
        $this->assertEquals('A terrible reason', $field->deprecationReason);
        $this->assertEquals('bar', $field->name);
        $this->assertEquals([], $field->args);
    }