Esempio n. 1
0
 /**
  * @code
  * phpunit -v --filter testExpirationCausesNull -c app/ vendor/urodoz/cachemanager/Urodoz/Bundle/CacheBundle/Tests/Service/CacheItem/CacheItemStoreTest.php
  * @endcode
  * @dataProvider providerInmutableDataThroughItem
  */
 public function testExpirationCausesNull($item)
 {
     $cacheItemStore = new CacheItemStore();
     $cacheItemStore->createFromData($item, 0);
     $dataToBeCached = $cacheItemStore->getCacheData();
     $cacheItemStore2 = new CacheItemStore();
     $cacheItemStore2->hydrateFromCacheData($dataToBeCached);
     $this->assertEquals($cacheItemStore2->getData(), null);
 }
Esempio n. 2
0
 /**
  * {@inheritDoc}
  */
 public function set($key, $value, $timeout = 3600)
 {
     $key = $this->updateCacheKey($key);
     //Create the unit to be stored
     $cacheItemStore = new CacheItemStore();
     $cacheItemStore->createFromData($value, $timeout);
     $valueToBeCached = $cacheItemStore->getCacheData();
     $result = $this->getActiveImplementation()->set($key, $valueToBeCached, $timeout);
     return $result;
 }