You are here

MemoryBackendTest.php in Drupal 9

Same filename and directory in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Cache/MemoryBackendTest.php

File

core/tests/Drupal/KernelTests/Core/Cache/MemoryBackendTest.php
View source
<?php

namespace Drupal\KernelTests\Core\Cache;

use Drupal\Core\Cache\MemoryBackend;

/**
 * Unit test of the memory cache backend using the generic cache unit test base.
 *
 * @group Cache
 */
class MemoryBackendTest extends GenericCacheBackendUnitTestBase {

  /**
   * Creates a new instance of MemoryBackend.
   *
   * @return
   *   A new MemoryBackend object.
   */
  protected function createCacheBackend($bin) {
    $backend = new MemoryBackend();
    \Drupal::service('cache_tags.invalidator')
      ->addInvalidator($backend);
    return $backend;
  }

}

Classes

Namesort descending Description
MemoryBackendTest Unit test of the memory cache backend using the generic cache unit test base.