Commit 9a534d92 authored by Dries's avatar Dries
Browse files

- Patch #1289364 by swentel: SchemaCache generates empty cid.

parent 61e9ec46
......@@ -2808,7 +2808,7 @@ class SchemaCache extends DrupalCacheArray {
public function __construct() {
// Cache by request method.
parent::__construct('schema:runtime:' . $_SERVER['REQUEST_METHOD'] == 'GET', 'cache');
parent::__construct('schema:runtime:' . ($_SERVER['REQUEST_METHOD'] == 'GET'), 'cache');
}
protected function resolveCacheMiss($offset) {
......
......@@ -152,14 +152,22 @@ class CacheSavingCase extends CacheTestCase {
$this->assertTrue(isset($cached->data) && $cached->data == $test_object, t('Object is saved and restored properly.'));
}
/*
/**
* Check or a variable is stored and restored properly.
**/
*/
function checkVariable($var) {
cache()->set('test_var', $var);
$cached = cache()->get('test_var');
$this->assertTrue(isset($cached->data) && $cached->data === $var, t('@type is saved and restored properly.', array('@type' => ucfirst(gettype($var)))));
}
/**
* Test no empty cids are written in cache table.
*/
function testNoEmptyCids() {
$this->drupalGet('user/register');
$this->assertFalse(cache_get(''), t('No cache entry is written with an empty cid.'));
}
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment