og-8.x-1.x-dev/tests/src/Unit/Cache/Context/OgCacheContextTestBase.php

tests/src/Unit/Cache/Context/OgCacheContextTestBase.php
<?php

declare(strict_types=1);

namespace Drupal\Tests\og\Unit\Cache\Context;

use Drupal\Core\Cache\Context\CacheContextInterface;
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.
   */
  abstract protected function getCacheContext(): CacheContextInterface;

  /**
   * Return the context result.
   *
   * @return string
   *   The context result.
   */
  protected function getContextResult(): string {
    return $this->getCacheContext()->getContext();
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc