You are here

ContextTest.php in GraphQL 8.3

File

modules/graphql_core/tests/src/Kernel/Context/ContextTest.php
View source
<?php

namespace Drupal\Tests\graphql_core\Kernel\Context;

use Drupal\Tests\graphql_core\Kernel\GraphQLCoreTestBase;

/**
 * Test plugin based schema generation.
 *
 * @group graphql_core
 */
class ContextTest extends GraphQLCoreTestBase {
  public static $modules = [
    'graphql_context_test',
  ];

  /**
   * Test if the schema is created properly.
   */
  public function testSimpleContext() {
    $query = $this
      ->getQueryFromFile('context.gql');
    $metadata = $this
      ->defaultCacheMetaData();
    $this
      ->assertResults($query, [], [
      'a' => [
        'name' => 'graphql_context_test.a',
      ],
      'b' => [
        'name' => 'graphql_context_test.b',
      ],
    ], $metadata);
  }

}

Classes

Namesort descending Description
ContextTest Test plugin based schema generation.