You are here

protected function ConfigStorageTestTrait::getSyncFileStorage in Config Filter 8.2

Same name and namespace in other branches
  1. 8 tests/src/Kernel/ConfigStorageTestTrait.php \Drupal\Tests\config_filter\Kernel\ConfigStorageTestTrait::getSyncFileStorage()

The file storage associated with the sync storage.

Use this to manipulate the files in the sync folder. In order to export the configuration to the sync storage use the following:

$this
  ->copyConfig($this
  ->getExportStorage(), $this
  ->getSyncFileStorage());

Return value

\Drupal\Core\Config\StorageInterface The storage with the files from the sync folder.

1 call to ConfigStorageTestTrait::getSyncFileStorage()
ExampleStorageKernelTest::testExampleImport in tests/src/Kernel/ExampleStorageKernelTest.php
Example to test import.

File

tests/src/Kernel/ConfigStorageTestTrait.php, line 81

Class

ConfigStorageTestTrait
Trait to easily test import and export of config by comparing storages.

Namespace

Drupal\Tests\config_filter\Kernel

Code

protected function getSyncFileStorage() : StorageInterface {

  // We do not return the config.storage.sync service so that we can bypass
  // config filter.
  return new FileStorage(Settings::get('config_sync_directory'));
}