You are here

protected function MockGraphQLPluginTrait::mockInputType in GraphQL 8.3

Mock a GraphQL input type.

Parameters

string $id: The input type id.

array $definition: The plugin definition. Will be merged with the input type defaults.

2 calls to MockGraphQLPluginTrait::mockInputType()
EntityMutationTest::setUp in modules/graphql_core/tests/src/Kernel/EntityMutation/EntityMutationTest.php
TestFrameworkTest::testMutationMock in tests/src/Kernel/Framework/TestFrameworkTest.php
Test mutation mocking.

File

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

Class

MockGraphQLPluginTrait
Trait for mocking GraphQL type system plugins.

Namespace

Drupal\Tests\graphql\Traits

Code

protected function mockInputType($id, array $definition, $builder = NULL) {
  $definition = $this
    ->getTypeSystemPluginDefinition(GraphQLInputType::class, $definition + [
    'id' => $id,
    'class' => InputTypePluginBase::class,
    'mock_factory' => 'mockInputTypeFactory',
  ]);
  $this->graphQLPlugins[InputTypePluginBase::class][$id] = [
    'definition' => $definition,
    'builder' => $builder,
  ];
}