public function CacheItemTest::test in Flysystem 2.0.x
Same name and namespace in other branches
- 8 tests/src/Unit/Flysystem/Adapter/CacheItemTest.php \Drupal\Tests\flysystem\Unit\Flysystem\Adapter\CacheItemTest::test()
- 3.x tests/src/Unit/Flysystem/Adapter/CacheItemTest.php \Drupal\Tests\flysystem\Unit\Flysystem\Adapter\CacheItemTest::test()
- 3.0.x tests/src/Unit/Flysystem/Adapter/CacheItemTest.php \Drupal\Tests\flysystem\Unit\Flysystem\Adapter\CacheItemTest::test()
Tests metadata updating and getting.
File
- tests/
src/ Unit/ Flysystem/ Adapter/ CacheItemTest.php, line 21
Class
Namespace
Drupal\Tests\flysystem\Unit\Flysystem\AdapterCode
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());
}