public function testShouldUseOutputFrontend() { $time = date('H:i:s'); $frontCache = new CacheOutput(['lifetime' => 10]); $cache = new CacheAerospike($frontCache, $this->getConfig()); ob_start(); $content = $cache->start('test-output'); $this->keys[] = 'test-output'; $this->assertNull($content); echo $time; $obContent = ob_get_contents(); $cache->save(null, null, null, true); ob_end_clean(); $this->assertEquals($time, $obContent); $this->assertEquals($time, $cache->get('test-output')); $content = $cache->start('test-output'); $this->assertEquals($content, $obContent); $this->assertEquals($content, $cache->get('test-output')); $keys = $cache->queryKeys(); $this->assertEquals([0 => 'test-output'], $keys); }
/** * {@inheritdoc} * * @param string $sessionId Session variable name * @param string $data Session data */ public function write($sessionId, $data) { return $this->db->save($sessionId, $data, $this->lifetime); }