You are here

public function TestDiscoveryCacheContext::getContext in Drupal 8

Returns the string representation of the cache context.

A cache context service's name is used as a token (placeholder) cache key, and is then replaced with the string returned by this method.

Return value

string The string representation of the cache context.

Overrides CacheContextInterface::getContext

File

core/modules/simpletest/src/Cache/Context/TestDiscoveryCacheContext.php, line 66

Class

TestDiscoveryCacheContext
Defines the TestDiscoveryCacheContext service.

Namespace

Drupal\simpletest\Cache\Context

Code

public function getContext() {
  if (empty($this->hash)) {
    $tests = $this->testDiscovery
      ->getTestClasses();
    $this->hash = $this
      ->hash(serialize($tests));
  }
  return $this->hash;
}