MemoryBackendTest.php

Same filename in this branch
  1. 9 core/tests/Drupal/Tests/Core/Flood/MemoryBackendTest.php
Same filename and directory in other branches
  1. 8.9.x core/tests/Drupal/KernelTests/Core/Cache/MemoryBackendTest.php
  2. 10 core/tests/Drupal/KernelTests/Core/Cache/MemoryBackendTest.php
  3. 10 core/tests/Drupal/Tests/Core/Flood/MemoryBackendTest.php
  4. 11.x core/tests/Drupal/KernelTests/Core/Cache/MemoryBackendTest.php
  5. 11.x core/tests/Drupal/Tests/Core/Flood/MemoryBackendTest.php

Namespace

Drupal\KernelTests\Core\Cache

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 \Drupal\Core\Cache\CacheBackendInterface
     *   A new MemoryBackend object.
     */
    protected function createCacheBackend($bin) {
        $backend = new MemoryBackend();
        \Drupal::service('cache_tags.invalidator')->addInvalidator($backend);
        return $backend;
    }

}

Classes

Title Deprecated Summary
MemoryBackendTest Unit test of the memory cache backend using the generic cache unit test base.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.