You are here

protected function MockingTrait::setUpSchema in GraphQL 8.4

Setup server with schema.

Parameters

string $schema: GraphQL schema description.

string $id: Schema id.

array $values:

28 calls to MockingTrait::setUpSchema()
BufferedFieldTest::setUp in tests/src/Kernel/Framework/BufferedFieldTest.php
DisabledResultCacheTest::setUp in tests/src/Kernel/Framework/DisabledResultCacheTest.php
EntityBufferTest::setUp in tests/src/Kernel/EntityBufferTest.php
EntityDefinitionTest::setUp in tests/src/Kernel/DataProducer/EntityDefinitionTest.php
EntityUuidBufferTest::setUp in tests/src/Kernel/EntityUuidBufferTest.php

... See full list

File

tests/src/Traits/MockingTrait.php, line 85

Class

MockingTrait
Contains helpers for setting up mock servers and schemas for testing.

Namespace

Drupal\Tests\graphql\Traits

Code

protected function setUpSchema($schema, $id = 'test', array $values = []) : void {
  $this
    ->mockSchema($id, $schema);
  $this
    ->mockSchemaPluginManager($id);
  $this
    ->createTestServer($id, '/graphql/' . $id, $values);
  $this->schemaPluginManager
    ->method('createInstance')
    ->with($this
    ->equalTo($id))
    ->will($this
    ->returnValue($this->schema));
  $this->container
    ->set('plugin.manager.graphql.schema', $this->schemaPluginManager);
}