CacheItemTest.php in Flysystem 3.0.x
File
tests/src/Unit/Flysystem/Adapter/CacheItemTest.php
View source
<?php
namespace Drupal\Tests\flysystem\Unit\Flysystem\Adapter;
use Drupal\flysystem\Flysystem\Adapter\CacheItem;
use Drupal\Tests\UnitTestCase;
class CacheItemTest extends UnitTestCase {
public function test() {
$cache_item = new CacheItem();
$metadata = [
'size' => 1234,
'mimetype' => 'test_mimetype',
'visibility' => 'public',
'timestamp' => 123456,
'type' => 'file',
'contents' => 'test contents',
'path' => 'file_path',
];
$cache_item
->updateMetadata($metadata);
unset($metadata['contents'], $metadata['path']);
$this
->assertSame($metadata, $cache_item
->getMetadata());
}
}