You are here

public function CacheItemBackendTest::testDelete in Flysystem 8

Same name and namespace in other branches
  1. 3.x tests/src/Unit/Flysystem/Adapter/CacheItemBackendTest.php \Drupal\Tests\flysystem\Unit\Flysystem\Adapter\CacheItemBackendTest::testDelete()
  2. 2.0.x tests/src/Unit/Flysystem/Adapter/CacheItemBackendTest.php \Drupal\Tests\flysystem\Unit\Flysystem\Adapter\CacheItemBackendTest::testDelete()
  3. 3.0.x tests/src/Unit/Flysystem/Adapter/CacheItemBackendTest.php \Drupal\Tests\flysystem\Unit\Flysystem\Adapter\CacheItemBackendTest::testDelete()

Tests deleting by a path.

File

tests/src/Unit/Flysystem/Adapter/CacheItemBackendTest.php, line 70

Class

CacheItemBackendTest
@group flysystem

Namespace

Drupal\Tests\flysystem\Unit\Flysystem\Adapter

Code

public function testDelete() {
  $cache_item = new CacheItem();
  $cache_item
    ->updateMetadata([
    'mimetype' => 'test_mimetype',
  ]);
  $this->cacheItemBackend
    ->set('test_path', $cache_item);
  $this->cacheItemBackend
    ->delete('test_path');
  $metadata = $this->cacheItemBackend
    ->load('test_path')
    ->getMetadata();
  $this
    ->assertTrue(empty($metadata['mimetype']));
}