You are here

protected function QueryResultAssertionTrait::defaultCacheMetaData in GraphQL 8.3

Same name and namespace in other branches
  1. 8.4 tests/src/Traits/QueryResultAssertionTrait.php \Drupal\Tests\graphql\Traits\QueryResultAssertionTrait::defaultCacheMetaData()

The default cache metadata object.

Return value

\Drupal\Core\Cache\CacheableMetadata The cache metadata object.

39 calls to QueryResultAssertionTrait::defaultCacheMetaData()
BlockTest::testStaticBlocks in modules/graphql_core/tests/src/Kernel/Blocks/BlockTest.php
Test if two static blocks are in the content area.
BreadcrumbsTest::testBreadcrumbs in modules/graphql_core/tests/src/Kernel/Breadcrumbs/BreadcrumbsTest.php
Test that the breadcrumb query returns breadcrumbs for given path.
BufferedFieldTest::testBatchedFields in tests/src/Kernel/Framework/BufferedFieldTest.php
Test if the schema is created properly.
ContextTest::testSimpleContext in modules/graphql_core/tests/src/Kernel/Context/ContextTest.php
Test if the schema is created properly.
EntityBasicFieldsTest::testBasicFields in modules/graphql_core/tests/src/Kernel/Entity/EntityBasicFieldsTest.php
Test if the basic fields are available on the interface.

... See full list

File

tests/src/Traits/QueryResultAssertionTrait.php, line 64

Class

QueryResultAssertionTrait
Trait for easier assertion on GraphQL query results.

Namespace

Drupal\Tests\graphql\Traits

Code

protected function defaultCacheMetaData() {
  $metadata = new CacheableMetadata();
  $metadata
    ->setCacheMaxAge($this
    ->defaultCacheMaxAge());
  $metadata
    ->setCacheTags($this
    ->defaultCacheTags());
  $metadata
    ->setCacheContexts($this
    ->defaultCacheContexts());
  return $metadata;
}