You are here

protected function GraphQLContentTestBase::mockNode in GraphQL 8.3

Mock a field that emits a test node.

``` query { node { title } } ```

Parameters

mixed $values: Additional node values.

string $title: An optional title. Will default to "Test".

3 calls to GraphQLContentTestBase::mockNode()
EntityFieldValueTest::testBoolean in modules/graphql_core/tests/src/Kernel/Entity/EntityFieldValueTest.php
Test boolean fields.
EntityFieldValueTest::testFilteredText in modules/graphql_core/tests/src/Kernel/Entity/EntityFieldValueTest.php
Test filtered text fields.
EntityFieldValueTest::testText in modules/graphql_core/tests/src/Kernel/Entity/EntityFieldValueTest.php
Test a simple text field.

File

modules/graphql_core/tests/src/Kernel/GraphQLContentTestBase.php, line 81

Class

GraphQLContentTestBase
Base class for node based tests.

Namespace

Drupal\Tests\graphql_core\Kernel

Code

protected function mockNode($values, $title = 'Test') {
  $this
    ->mockField('node', [
    'name' => 'node',
    'type' => 'entity:node:test',
  ], Node::create([
    'title' => $title,
    'type' => 'test',
  ] + $values));
}