.../modules/entity_test/entity_test.services.yml | 4 +++ .../src/Cache/EntityTestViewGrantsCacheContext.php | 33 ++++++++++++++++++++++ .../Tests/Core/Render/RendererBubblingTest.php | 5 ++++ 3 files changed, 42 insertions(+) diff --git a/core/modules/system/tests/modules/entity_test/entity_test.services.yml b/core/modules/system/tests/modules/entity_test/entity_test.services.yml index 8769fbc..75e1bf3 100644 --- a/core/modules/system/tests/modules/entity_test/entity_test.services.yml +++ b/core/modules/system/tests/modules/entity_test/entity_test.services.yml @@ -4,3 +4,7 @@ services: arguments: ['@state'] tags: - { name: event_subscriber } + cache_context.entity_test_view_grants: + class: Drupal\entity_test\Cache\EntityTestViewGrantsCacheContext + tags: + - { name: cache.context } diff --git a/core/modules/system/tests/modules/entity_test/src/Cache/EntityTestViewGrantsCacheContext.php b/core/modules/system/tests/modules/entity_test/src/Cache/EntityTestViewGrantsCacheContext.php index e69de29..9c2acc5 100644 --- a/core/modules/system/tests/modules/entity_test/src/Cache/EntityTestViewGrantsCacheContext.php +++ b/core/modules/system/tests/modules/entity_test/src/Cache/EntityTestViewGrantsCacheContext.php @@ -0,0 +1,33 @@ +setParameter('cache_contexts', ['foo', 'bar', 'baz', 'user.roles', 'child.cache_context']); + \Drupal::setContainer($container); + $this->setUpRequest(); $this->setupMemoryCache(); }