public function FileCacheTest::testDelete in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Component/FileCache/FileCacheTest.php \Drupal\Tests\Component\FileCache\FileCacheTest::testDelete()
- 10 core/tests/Drupal/Tests/Component/FileCache/FileCacheTest.php \Drupal\Tests\Component\FileCache\FileCacheTest::testDelete()
@covers ::delete
File
- core/
tests/ Drupal/ Tests/ Component/ FileCache/ FileCacheTest.php, line 125
Class
- FileCacheTest
- @coversDefaultClass \Drupal\Component\FileCache\FileCache @group FileCache
Namespace
Drupal\Tests\Component\FileCacheCode
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);
}