protected function runTests(CacheBackend $backend, $lifetime = null)
{
$backend->save($this->key, $this->data, $lifetime);
$this->assertTrue($backend->exists($this->key));
$this->assertEquals($this->data, $backend->get($this->key));
$this->assertNotEmpty($backend->queryKeys());
$this->assertNotEmpty($backend->queryKeys('DB_'));
$this->assertTrue($backend->delete($this->key));
$this->assertFalse($backend->delete($this->key));
if (null !== $lifetime) {
$backend->save($this->key, $this->data, $lifetime);
$this->assertTrue($backend->exists($this->key, $lifetime));
$this->assertEquals($this->data, $backend->get($this->key, $lifetime));
$backend->save($this->key, $this->data, -$lifetime);
$this->assertFalse($backend->exists($this->key, -$lifetime));
}
}