You are here

OgCacheContextTestBase.php in Organic groups 8

File

tests/src/Unit/Cache/Context/OgCacheContextTestBase.php
View 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

Namesort descending Description
OgCacheContextTestBase Base class for testing cache context services.