class NullBackendTest
Same name and namespace in other branches
- 11.x core/tests/Drupal/Tests/Core/Cache/NullBackendTest.php \Drupal\Tests\Core\Cache\NullBackendTest
- 10 core/tests/Drupal/Tests/Core/Cache/NullBackendTest.php \Drupal\Tests\Core\Cache\NullBackendTest
- 8.9.x core/tests/Drupal/Tests/Core/Cache/NullBackendTest.php \Drupal\Tests\Core\Cache\NullBackendTest
Tests the cache NullBackend.
@group Cache
Hierarchy
- class \Drupal\Tests\UnitTestCase uses \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\Core\Cache\NullBackendTest extends \Drupal\Tests\UnitTestCase
Expanded class hierarchy of NullBackendTest
File
-
core/
tests/ Drupal/ Tests/ Core/ Cache/ NullBackendTest.php, line 13
Namespace
Drupal\Tests\Core\CacheView source
class NullBackendTest extends UnitTestCase {
/**
* Tests that the NullBackend does not actually store variables.
*/
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));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.