You are here

public function DrupalCacheAdapterTest::testSetVisibilitySuccess in Flysystem 8

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

File

tests/src/Unit/Flysystem/Adapter/DrupalCacheAdapterTest.php, line 190

Class

DrupalCacheAdapterTest
Test the Drupal Cache Adapter.

Namespace

Drupal\Tests\flysystem\Unit\Flysystem\Adapter

Code

public function testSetVisibilitySuccess() {
  $config = new Config();
  $this->adapter
    ->setVisibility(static::FILE, 'private')
    ->willReturn([
    'visibility' => 'private',
  ]);
  $metadata = $this->cacheAdapter
    ->setVisibility(static::FILE, 'private');
  $this
    ->assertSame('private', $metadata['visibility']);
  $this
    ->assertSame('private', $this->cacheAdapter
    ->getVisibility(static::FILE)['visibility']);
  $this
    ->assertTrue($this->cacheItemBackend
    ->has(static::FILE));
}