You are here

protected function MockGraphQLPluginTrait::mockInputTypeFactory in GraphQL 8.3

File

tests/src/Traits/MockGraphQLPluginTrait.php, line 439

Class

MockGraphQLPluginTrait
Trait for mocking GraphQL type system plugins.

Namespace

Drupal\Tests\graphql\Traits

Code

protected function mockInputTypeFactory($definition, $builder) {
  $input = $this
    ->getMockForAbstractClass(InputTypePluginBase::class, [
    [],
    $definition['id'],
    $definition,
  ]);
  if (is_callable($builder)) {
    $builder($input);
  }
  return $input;
}