You are here

public function LocalTest::setUp in Flysystem 8

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

Overrides UnitTestCase::setUp

File

tests/src/Unit/Flysystem/LocalTest.php, line 24

Class

LocalTest
@coversDefaultClass \Drupal\flysystem\Flysystem\Local @group flysystem

Namespace

Drupal\Tests\flysystem\Unit\Flysystem

Code

public function setUp() {
  parent::setUp();
  $GLOBALS['base_url'] = 'http://example.com';
  $container = new ContainerBuilder();
  $url_generator = $this
    ->prophesize(UrlGeneratorInterface::class);
  $url_generator
    ->generateFromRoute(Argument::cetera())
    ->willReturn('download');
  $container
    ->set('url_generator', $url_generator
    ->reveal());
  \Drupal::setContainer($container);
  (new LocalAdapter('foo/bar'))
    ->deleteDir('');
  @rmdir('foo/bar');
  @rmdir('foo');
  mkdir('foo');
  mkdir('foo/bar');
  touch('test.txt');
}