Ejemplo n.º 1
0
 private function serializeContext()
 {
     $backup = $this->getContext();
     $this->set(self::DATA_CONTEXT, $backup->serialize());
     $result = parent::serialize();
     $this->set(self::DATA_CONTEXT, $backup);
     return $result;
 }
Ejemplo n.º 2
0
 private function stubCacheEntry($content, $file, $time, $files = null)
 {
     $list = is_null($files) ? [$file => $time] : $files;
     $entry = new CacheEntry($content, $list, $time);
     $this->cache->setHas($file, $time);
     $this->cache->setEntry($file, $entry->serialize());
     return $entry;
 }
Ejemplo n.º 3
0
 /**
  * @test
  */
 public function unserialize_sucessEmpty()
 {
     $input = new CacheEntry();
     $target = new CacheEntry('example', ['example.file' => new DateTime()], new DateTime());
     $target->unserialize($input->serialize());
     $this->assertNull($target->getContent());
     $this->assertNull($target->getFiles());
     $this->assertNull($target->getLastModified());
 }