You are here

public function InstallFunctionsTest::setUp in Flysystem 3.x

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

Overrides UnitTestCase::setUp

File

tests/src/Unit/InstallFunctionsTest.php, line 29

Class

InstallFunctionsTest
Tests flysystem.install functions.

Namespace

Drupal\Tests\flysystem\Unit

Code

public function setUp() {
  parent::setUp();
  if (!defined('REQUIREMENT_ERROR')) {
    define('REQUIREMENT_ERROR', 2);
  }
  require_once dirname(dirname(dirname(__DIR__))) . '/flysystem.install';
  $this->factory = $this
    ->prophesize(FlysystemFactory::class);
  $container = new ContainerBuilder();
  $container
    ->set('flysystem_factory', $this->factory
    ->reveal());
  $container
    ->set('string_translation', $this
    ->getStringTranslationStub());
  \Drupal::setContainer($container);
}