public function testMetaDataSuccess() { $storage = new ezcCacheStorageFileApcArray($this->getTempDir(__CLASS__), array('ttl' => 1)); $storage->reset(); $metaDataKey = urlencode($storage->getLocation()) . '_' . $storage->options->metaDataKey; $meta = new ezcCacheStackLruMetaData(); $meta->setState(array('replacementData' => array('id_1' => 23, 'id_2' => 42), 'storageData' => array('storage_id_1' => array('id_1' => true, 'id_2' => true), 'storage_id_2' => array('id_2' => true)))); $this->assertFalse(apc_fetch($metaDataKey), 'Meta data key existed before the storage was created.'); $storage->storeMetaData($meta); $this->assertEquals($meta, apc_fetch($metaDataKey)->var, 'Meta data file existed before the storage was created.'); $restoredMeta = $storage->restoreMetaData(); $this->assertEquals($meta, $restoredMeta, 'Meta data not restored correctly.'); $this->assertEquals($meta, apc_fetch($metaDataKey)->var, 'Meta data file existed before the storage was created.'); $this->removeTempDir(); }