You are here

public function ResultTest::testQuery in GraphQL 8.4

Same name and namespace in other branches
  1. 8.3 tests/src/Kernel/Framework/ResultTest.php \Drupal\Tests\graphql\Kernel\Framework\ResultTest::testQuery()

Test a simple query result.

File

tests/src/Kernel/Framework/ResultTest.php, line 37

Class

ResultTest
Test the whole query result pipeline.

Namespace

Drupal\Tests\graphql\Kernel\Framework

Code

public function testQuery() : void {
  $result = $this
    ->query('query { root }');
  $this
    ->assertSame(200, $result
    ->getStatusCode());
  $this
    ->assertSame([
    'data' => [
      'root' => 'test',
    ],
  ], json_decode($result
    ->getContent(), TRUE));
}