Commit a4f2506b authored by alexpott's avatar alexpott

Issue #2298485 by damiankloip: Fixed setMultiple should also use microtime in the DatabaseBackend.

parent 5dd37769
......@@ -253,7 +253,7 @@ public function setMultiple(array $items) {
$fields = array(
'cid' => $cid,
'expire' => $item['expire'],
'created' => REQUEST_TIME,
'created' => round(microtime(TRUE), 3),
'tags' => implode(' ', $flat_tags),
'checksum_invalidations' => $checksum['invalidations'],
'checksum_deletions' => $checksum['deletions'],
......
......@@ -383,6 +383,8 @@ public function testSetMultiple() {
$cached = $backend->getMultiple($cids);
$this->assertEqual($cached['cid_1']->data, $items['cid_1']['data'], 'Over-written cache item set correctly.');
$this->assertTrue($cached['cid_1']->valid, 'Item is marked as valid.');
$this->assertTrue($cached['cid_1']->created >= REQUEST_TIME && $cached['cid_1']->created <= round(microtime(TRUE), 3), 'Created time is correct.');
$this->assertEqual($cached['cid_1']->expire, CacheBackendInterface::CACHE_PERMANENT, 'Cache expiration defaults to permanent.');
$this->assertEqual($cached['cid_2']->data, $items['cid_2']['data'], 'New cache item set correctly.');
......
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