Tests the cache NullBackend.
@group Cache
Expanded class hierarchy of NullBackendTest
class NullBackendTest extends UnitTestCase {
public static function getInfo() {
return array(
'name' => 'Cache NullBackend test',
'description' => 'Tests the cache NullBackend.',
'group' => 'Cache',
);
}
/**
* Tests that the NullBackend does not actually store variables.
*/
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));
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
NullBackendTest:: |
public static | function |
This method exists to support the simpletest UI runner. Overrides UnitTestCase:: |
|
NullBackendTest:: |
function | Tests that the NullBackend does not actually store variables. | ||
UnitTestCase:: |
public | function | Returns a stub config factory that behaves according to the passed in array. | |
UnitTestCase:: |
public | function | Returns a stub config storage that returns the supplied configuration. | |
UnitTestCase:: |
public static | function | Generates a random string containing letters and numbers. |