You are here

public function ResolverRegistryTest::setUp in GraphQL 8.4

Overrides GraphQLTestBase::setUp

File

tests/src/Kernel/ResolverRegistryTest.php, line 19

Class

ResolverRegistryTest
Tests that the resolver registry behaves correctly.

Namespace

Drupal\Tests\graphql\Kernel

Code

public function setUp() : void {
  parent::setUp();
  $schema = <<<GQL
      type Query {
        transportation: Vehicle
      }

      interface Vehicle {
        model: String
      }

      interface Car implements Vehicle {
        model: String
      }

      type Cabrio implements Car {
        model: String
      }
GQL;
  $this
    ->setUpSchema($schema);

  // Our mocking trait sets up the ResolverRegistry that we're interested in
  // testing for us. This assertion guards against the mock implementation
  // invalidating that and this test becoming useless.
  self::assertInstanceOf(ResolverRegistry::class, $this->registry);
}