コード例 #1
0
 private function setCache($iterator, $value, $files)
 {
     $key = $this->target->generateCacheKey($iterator);
     $entry = new CacheBinderEntry($value, $files, new DateTime());
     $entry->setMimeType('text/css');
     $entry->setContext(new Context());
     $this->cache->setHas($key);
     $this->cache->setEntry($key, $entry->serialize());
 }
コード例 #2
0
 /**
  * @test
  */
 public function process_successInternalRequestEntryCache()
 {
     $file = 'example.file';
     $time = new DateTime();
     $files = [$file => $time];
     $this->stubProcessor($file, 'content', $time, $files);
     $this->target->process($file);
     $this->cache->setHas($file);
     $this->stubProcessor($file, 'changed', $time, $files);
     $this->assertEquals('content', $this->target->process($file));
     $this->assertCacheEntry($file, 'content', $time, $files);
 }