public function NullBackendTest::testNullBackend in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Cache/NullBackendTest.php \Drupal\Tests\Core\Cache\NullBackendTest::testNullBackend()
Tests that the NullBackend does not actually store variables.
File
- core/tests/ Drupal/ Tests/ Core/ Cache/ NullBackendTest.php, line 18 
Class
- NullBackendTest
- Tests the cache NullBackend.
Namespace
Drupal\Tests\Core\CacheCode
public function testNullBackend() {
  $null_cache = new NullBackend('test');
  $key = $this
    ->randomMachineName();
  $value = $this
    ->randomMachineName();
  $null_cache
    ->set($key, $value);
  $this
    ->assertFalse($null_cache
    ->get($key));
}