You are here

protected function FileStorageTest::setUp in Drupal 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/tests/Drupal/KernelTests/Core/Config/Storage/FileStorageTest.php \Drupal\KernelTests\Core\Config\Storage\FileStorageTest::setUp()
Same name and namespace in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Config/Storage/FileStorageTest.php \Drupal\KernelTests\Core\Config\Storage\FileStorageTest::setUp()

Overrides KernelTestBase::setUp

File

core/tests/Drupal/KernelTests/Core/Config/Storage/FileStorageTest.php, line 27

Class

FileStorageTest
Tests FileStorage operations.

Namespace

Drupal\KernelTests\Core\Config\Storage

Code

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

  // Create a directory.
  $this->directory = PublicStream::basePath() . '/config';
  $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', [
    'module' => [],
  ]);
}