You are here

protected function OgRoleCacheContextTest::getCacheContext in Organic groups 8

Same name in this branch
  1. 8 tests/src/Unit/Cache/Context/OgRoleCacheContextTest.php \Drupal\Tests\og\Unit\Cache\Context\OgRoleCacheContextTest::getCacheContext()
  2. 8 tests/src/Kernel/Cache/Context/OgRoleCacheContextTest.php \Drupal\Tests\og\Kernel\Cache\Context\OgRoleCacheContextTest::getCacheContext()

Returns the instantiated cache context service which is being tested.

Return value

\Drupal\Core\Cache\Context\CacheContextInterface The instantiated cache context service.

Overrides OgCacheContextTestBase::getCacheContext

File

tests/src/Unit/Cache/Context/OgRoleCacheContextTest.php, line 211

Class

OgRoleCacheContextTest
Tests the OG role cache context.

Namespace

Drupal\Tests\og\Unit\Cache\Context

Code

protected function getCacheContext(?AccountInterface $user = NULL) : CacheContextInterface {
  return new OgRoleCacheContext($user, $this->entityTypeManager
    ->reveal(), $this->membershipManager
    ->reveal(), $this->database
    ->reveal(), $this->privateKey
    ->reveal());
}