public function testFromDao() { $dao = new CacheDao(); $dao->key = 'cacheKey'; $dao->data = 'data'; $item = CacheItem::fromDao($dao); $this->assertEquals($dao->key, $item->getKey()); $this->assertEquals($dao->data, $item->get()); }
/** * Delete the DAO from the data store * * @param IDao $dao * * @return IDao * * @throws DataStoreException */ public function delete(IDao $dao) { $dao = $this->_verifyDao($dao); $this->_connectedConnection()->deleteItem(CacheItem::fromDao($dao)); return $dao; }