OgCacheContextTestBase.php in Organic groups 8
Namespace
Drupal\Tests\og\Unit\Cache\ContextFile
tests/src/Unit/Cache/Context/OgCacheContextTestBase.phpView source
<?php
declare (strict_types=1);
namespace Drupal\Tests\og\Unit\Cache\Context;
use Drupal\Tests\UnitTestCase;
/**
* Base class for testing cache context services.
*/
abstract class OgCacheContextTestBase extends UnitTestCase {
/**
* Returns the instantiated cache context service which is being tested.
*
* @return \Drupal\Core\Cache\Context\CacheContextInterface
* The instantiated cache context service.
*/
protected abstract function getCacheContext();
/**
* Return the context result.
*
* @return string
* The context result.
*/
protected function getContextResult() {
return $this
->getCacheContext()
->getContext();
}
}
Classes
Name | Description |
---|---|
OgCacheContextTestBase | Base class for testing cache context services. |