You are here

protected function FileStorageTest::setUp in Zircon Profile 8

Same name in this branch
  1. 8 core/tests/Drupal/Tests/Component/PhpStorage/FileStorageTest.php \Drupal\Tests\Component\PhpStorage\FileStorageTest::setUp()
  2. 8 core/modules/config/src/Tests/Storage/FileStorageTest.php \Drupal\config\Tests\Storage\FileStorageTest::setUp()
Same name and namespace in other branches
  1. 8.0 core/modules/config/src/Tests/Storage/FileStorageTest.php \Drupal\config\Tests\Storage\FileStorageTest::setUp()

Performs setup tasks before each individual test method is run.

Overrides KernelTestBase::setUp

File

core/modules/config/src/Tests/Storage/FileStorageTest.php, line 30
Contains \Drupal\config\Tests\Storage\FileStorageTest.

Class

FileStorageTest
Tests FileStorage operations.

Namespace

Drupal\config\Tests\Storage

Code

protected function setUp() {
  parent::setUp();

  // Create a directory.
  $this->directory = $this->publicFilesDirectory . '/config';
  mkdir($this->directory);
  $this->storage = new FileStorage($this->directory);
  $this->invalidStorage = new FileStorage($this->directory . '/nonexisting');

  // FileStorage::listAll() requires other configuration data to exist.
  $this->storage
    ->write('system.performance', $this
    ->config('system.performance')
    ->get());
  $this->storage
    ->write('core.extension', array(
    'module' => array(),
  ));
}