Example #1
0
 /**
  * {@inheritdoc}
  */
 public function delete($filepath)
 {
     $realpath = realpath($filepath);
     $cid = $this->prefix . ':' . $this->collection . ':' . $realpath;
     unset(static::$cached[$cid]);
     if ($this->cache) {
         $this->cache->delete($cid);
     }
 }
Example #2
0
 /**
  * @covers ::delete
  */
 public function testDelete()
 {
     $filename = __DIR__ . '/Fixtures/llama-23.txt';
     $realpath = realpath($filename);
     $cid = 'prefix:test:' . $realpath;
     $this->fileCache->set($filename, 23);
     // Ensure data is removed after deletion.
     $this->fileCache->delete($filename);
     $result = $this->staticFileCache->fetch([$cid]);
     $this->assertEquals([], $result);
     $result = $this->fileCache->get($filename);
     $this->assertNull($result);
 }