You are here

public function FlysystemFactoryTest::testGetFilesystemReturnsReplicateAdapter in Flysystem 8

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

@covers ::getFilesystem @covers ::getAdapter

File

tests/src/Unit/FlysystemFactoryTest.php, line 120

Class

FlysystemFactoryTest
@coversDefaultClass \Drupal\flysystem\FlysystemFactory @group flysystem

Namespace

Drupal\Tests\flysystem\Unit

Code

public function testGetFilesystemReturnsReplicateAdapter() {

  // Test replicate.
  $this->plugin_manager
    ->createInstance('wrapped', [])
    ->willReturn($this->plugin
    ->reveal());
  new Settings([
    'flysystem' => [
      'testscheme' => [
        'driver' => 'testdriver',
        'replicate' => 'wrapped',
      ],
      'wrapped' => [
        'driver' => 'testdriver',
      ],
    ],
  ]);
  $factory = $this
    ->getFactory();
  $this
    ->assertInstanceOf(ReplicateAdapter::class, $factory
    ->getFilesystem('testscheme')
    ->getAdapter());
}