You are here

protected function MockGraphQLPluginTrait::mockInterfaceFactory in GraphQL 8.3

File

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

Class

MockGraphQLPluginTrait
Trait for mocking GraphQL type system plugins.

Namespace

Drupal\Tests\graphql\Traits

Code

protected function mockInterfaceFactory($definition, $builder = NULL) {
  $interface = $this
    ->getMockForAbstractClass(InterfacePluginBase::class, [
    [],
    $definition['id'],
    $definition,
  ]);
  if (is_callable($builder)) {
    $builder($interface);
  }
  return $interface;
}