public function DrupalCacheAdapterTest::testUpdateStreamSuccess in Flysystem 3.0.x
Same name and namespace in other branches
- 8 tests/src/Unit/Flysystem/Adapter/DrupalCacheAdapterTest.php \Drupal\Tests\flysystem\Unit\Flysystem\Adapter\DrupalCacheAdapterTest::testUpdateStreamSuccess()
- 3.x tests/src/Unit/Flysystem/Adapter/DrupalCacheAdapterTest.php \Drupal\Tests\flysystem\Unit\Flysystem\Adapter\DrupalCacheAdapterTest::testUpdateStreamSuccess()
- 2.0.x tests/src/Unit/Flysystem/Adapter/DrupalCacheAdapterTest.php \Drupal\Tests\flysystem\Unit\Flysystem\Adapter\DrupalCacheAdapterTest::testUpdateStreamSuccess()
File
- tests/
src/ Unit/ Flysystem/ Adapter/ DrupalCacheAdapterTest.php, line 103
Class
- DrupalCacheAdapterTest
- Test the Drupal Cache Adapter.
Namespace
Drupal\Tests\flysystem\Unit\Flysystem\AdapterCode
public function testUpdateStreamSuccess() {
$config = new Config();
$stream = fopen('data:text/plain,contents', 'rb');
$this->adapter
->updateStream(static::FILE, $stream, $config)
->willReturn([
'mimetype' => 'test_mimetype',
]);
$metadata = $this->cacheAdapter
->updateStream(static::FILE, $stream, $config);
$this
->assertSame('test_mimetype', $metadata['mimetype']);
$this
->assertSame('test_mimetype', $this->cacheAdapter
->getMimetype(static::FILE)['mimetype']);
$this
->assertTrue($this->cacheItemBackend
->has(static::FILE));
}