You are here

protected function EntityUuidBufferTest::setUp in GraphQL 8.4

Overrides GraphQLTestBase::setUp

File

tests/src/Kernel/EntityUuidBufferTest.php, line 28

Class

EntityUuidBufferTest
Tests the entity buffer with loading by UUID data producers.

Namespace

Drupal\Tests\graphql\Kernel

Code

protected function setUp() : void {
  parent::setUp();
  NodeType::create([
    'type' => 'test',
    'name' => 'Test',
  ])
    ->save();
  $this->nodeUuids = array_map(function ($i) {
    $node = Node::create([
      'title' => 'Node ' . $i,
      'type' => 'test',
    ]);
    $node
      ->save();
    return $node
      ->uuid();
  }, range(1, 3));
  $schema = <<<GQL
      type Query {
        node(uuid: String): Node
      }
      type Node {
        title: String!
      }
GQL;
  $this
    ->setUpSchema($schema);
}