You are here

public function SecureFieldTest::testInsecureField in GraphQL 8.3

Test if an insecure field is accessible.

File

tests/src/Kernel/Framework/SecureFieldTest.php, line 58

Class

SecureFieldTest
Test access restrictions on secure fields.

Namespace

Drupal\Tests\graphql\Kernel\Framework

Code

public function testInsecureField() {
  $metadata = $this
    ->defaultCacheMetaData();
  $metadata
    ->setCacheMaxAge(0);
  $this
    ->assertErrors('{ insecure }', [], [
    'Unable to resolve insecure field \'insecure\'.',
  ], $metadata);
}