protected function OgRoleCacheContextTest::getCacheContext in Organic groups 8
Same name in this branch
- 8 tests/src/Unit/Cache/Context/OgRoleCacheContextTest.php \Drupal\Tests\og\Unit\Cache\Context\OgRoleCacheContextTest::getCacheContext()
- 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.
Parameters
\Drupal\Core\Session\AccountInterface|null $user: The user account for which to return the cache context service.
Return value
\Drupal\Core\Cache\Context\CacheContextInterface The instantiated cache context service.
File
- tests/
src/ Kernel/ Cache/ Context/ OgRoleCacheContextTest.php, line 217
Class
- OgRoleCacheContextTest
- Tests the OG role cache context.
Namespace
Drupal\Tests\og\Kernel\Cache\ContextCode
protected function getCacheContext(?AccountInterface $user = NULL) : CacheContextInterface {
return new OgRoleCacheContext($user, $this->entityTypeManager, $this->membershipManager, $this->database, $this->privateKey);
}