function NullBackendTest::testNullBackend

Tests that the NullBackend does not actually store variables.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Cache/NullBackendTest.php, line 29
Definition of Drupal\system\Tests\Cache\NullBackendTest.

Class

NullBackendTest
Tests the cache NullBackend.

Namespace

Drupal\system\Tests\Cache

Code

function testNullBackend() {
  $null_cache = new NullBackend('test');
  $key = $this
    ->randomName();
  $value = $this
    ->randomName();
  $null_cache
    ->set($key, $value);
  $this
    ->assertTrue($null_cache
    ->isEmpty());
  $this
    ->assertFalse($null_cache
    ->get($key));
}