You are here

public function FlysystemFactoryTest::setUp in Flysystem 8

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

Overrides UnitTestCase::setUp

File

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

Class

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

Namespace

Drupal\Tests\flysystem\Unit

Code

public function setUp() {
  parent::setUp();
  $this->cache = new NullBackend('bin');
  $this->eventDispatcher = $this
    ->getMock(EventDispatcherInterface::class);
  $this->plugin_manager = $this
    ->prophesize(PluginManagerInterface::class);
  $this->plugin = $this
    ->prophesize(FlysystemPluginInterface::class);
  $this->plugin
    ->getAdapter()
    ->willReturn(new NullAdapter());
  $this->plugin_manager
    ->createInstance('testdriver', [])
    ->willReturn($this->plugin
    ->reveal());
  $this->plugin_manager
    ->createInstance('', [])
    ->willReturn(new Missing());
  $this->filesystem = $this
    ->prophesize(CoreFileSystemInterface::class);
  $this->filesystem
    ->validScheme(Argument::type('string'))
    ->willReturn(TRUE);
}