function FileCacheTest::testDelete
@legacy-covers ::delete
File
- 
              core/
tests/ Drupal/ Tests/ Component/ FileCache/ FileCacheTest.php, line 130  
Class
Namespace
Drupal\Tests\Component\FileCacheCode
public function testDelete() : void {
  $filename = __DIR__ . DIRECTORY_SEPARATOR . 'Fixtures' . DIRECTORY_SEPARATOR . '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);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.