You are here

protected function CachedStorageTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/config/src/Tests/Storage/CachedStorageTest.php \Drupal\config\Tests\Storage\CachedStorageTest::setUp()

Performs setup tasks before each individual test method is run.

Overrides KernelTestBase::setUp

File

core/modules/config/src/Tests/Storage/CachedStorageTest.php, line 36
Contains \Drupal\config\Tests\Storage\CachedStorageTest.

Class

CachedStorageTest
Tests CachedStorage operations.

Namespace

Drupal\config\Tests\Storage

Code

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

  // Create a directory.
  $dir = $this->publicFilesDirectory . '/config';
  mkdir($dir);
  $this->fileStorage = new FileStorage($dir);
  $this->storage = new CachedStorage($this->fileStorage, \Drupal::service('cache.config'));
  $this->cache = \Drupal::service('cache_factory')
    ->get('config');

  // ::listAll() verifications require other configuration data to exist.
  $this->storage
    ->write('system.performance', array());
}