You are here

NullBackendTest.php in Zircon Profile 8

Same filename and directory in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Cache/NullBackendTest.php

File

core/tests/Drupal/Tests/Core/Cache/NullBackendTest.php
View source
<?php

/**
 * @file
 * Contains \Drupal\Tests\Core\Cache\NullBackendTest.
 */
namespace Drupal\Tests\Core\Cache;

use Drupal\Core\Cache\NullBackend;
use Drupal\Tests\UnitTestCase;

/**
 * Tests the cache NullBackend.
 *
 * @group Cache
 */
class NullBackendTest extends UnitTestCase {

  /**
   * Tests that the NullBackend does not actually store variables.
   */
  function testNullBackend() {
    $null_cache = new NullBackend('test');
    $key = $this
      ->randomMachineName();
    $value = $this
      ->randomMachineName();
    $null_cache
      ->set($key, $value);
    $this
      ->assertFalse($null_cache
      ->get($key));
  }

}

Classes

Namesort descending Description
NullBackendTest Tests the cache NullBackend.