public function setUp()
{
$this->someScalarType = new CustomScalarType(['name' => 'SomeScalar', 'serialize' => function () {
}, 'parseValue' => function () {
}, 'parseLiteral' => function () {
}]);
$this->someObjectType = new ObjectType(['name' => 'SomeObject', 'fields' => ['f' => ['type' => Type::string()]]]);
$this->objectWithIsTypeOf = new ObjectType(['name' => 'ObjectWithIsTypeOf', 'isTypeOf' => function () {
return true;
}, 'fields' => ['f' => ['type' => Type::string()]]]);
$this->someUnionType = new UnionType(['name' => 'SomeUnion', 'resolveType' => function () {
return null;
}, 'types' => [$this->someObjectType]]);
$this->someInterfaceType = new InterfaceType(['name' => 'SomeInterface', 'resolveType' => function () {
return null;
}, 'fields' => ['f' => ['type' => Type::string()]]]);
$this->someEnumType = new EnumType(['name' => 'SomeEnum', 'resolveType' => function () {
return null;
}, 'fields' => ['f' => ['type' => Type::string()]]]);
$this->someInputObjectType = new InputObjectType(['name' => 'SomeInputObject', 'fields' => ['val' => ['type' => Type::float(), 'defaultValue' => 42]]]);
$this->outputTypes = $this->withModifiers([Type::string(), $this->someScalarType, $this->someEnumType, $this->someObjectType, $this->someUnionType, $this->someInterfaceType]);
$this->noOutputTypes = $this->withModifiers([$this->someInputObjectType]);
$this->noOutputTypes[] = 'SomeString';
$this->inputTypes = $this->withModifiers([Type::string(), $this->someScalarType, $this->someEnumType, $this->someInputObjectType]);
$this->noInputTypes = $this->withModifiers([$this->someObjectType, $this->someUnionType, $this->someInterfaceType]);
$this->noInputTypes[] = 'SomeString';
}