Skip to content
Snippets Groups Projects
Commit cc8147dd authored by catch's avatar catch
Browse files

Issue #1597888 by Niklas Fiekas, sun: Fixed Cache NullBackend is entirely...

Issue #1597888 by Niklas Fiekas, sun: Fixed Cache NullBackend is entirely broken, does not implement CacheBackendInterface.
parent c91177e0
No related branches found
No related tags found
Loading
......@@ -42,7 +42,7 @@ function getMultiple(&$cids) {
/**
* Implements Drupal\Core\Cache\CacheBackendInterface::set().
*/
function set($cid, $data, $expire = CACHE_PERMANENT) {}
function set($cid, $data, $expire = CACHE_PERMANENT, array $tags = array()) {}
/**
* Implements Drupal\Core\Cache\CacheBackendInterface::delete().
......@@ -74,6 +74,11 @@ function expire() {}
*/
function garbageCollection() {}
/**
* Implements Drupal\Core\Cache\CacheBackendInterface::invalidateTags().
*/
public function invalidateTags(array $tags) {}
/**
* Implements Drupal\Core\Cache\CacheBackendInterface::isEmpty().
*/
......
<?php
/**
* @file
* Definition of Drupal\system\Tests\Cache\NullBackendTest.
*/
namespace Drupal\system\Tests\Cache;
use Drupal\Core\Cache\NullBackend;
use Drupal\simpletest\UnitTestBase;
/**
* Tests the cache NullBackend.
*/
class NullBackendTest extends UnitTestBase {
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));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment