You are here

protected function SplitTestTrait::getSplitSourceStorage in Configuration Split 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Kernel/SplitTestTrait.php \Drupal\Tests\config_split\Kernel\SplitTestTrait::getSplitSourceStorage()

Get the storage for a split.

Parameters

\Drupal\Core\Config\Config $config: The split config.

Return value

\Drupal\Core\Config\StorageInterface The storage.

8 calls to SplitTestTrait::getSplitSourceStorage()
IndividualExportImportTest::testExportEmptyFiles in tests/src/Kernel/IndividualExportImportTest.php
Test exporting when there is no files in the system.
IndividualExportImportTest::testExportNonEmptyFiles in tests/src/Kernel/IndividualExportImportTest.php
Test exporting when there is already data to be overwritten.
IndividualExportImportTest::testImport in tests/src/Kernel/IndividualExportImportTest.php
Test importing of a split.
SplitMergeTest::testCompleteAndConditionalSplitExport in tests/src/Kernel/SplitMergeTest.php
Test complete and conditional split export.
SplitMergeTest::testConditionalSplitWithModuleConfig in tests/src/Kernel/SplitMergeTest.php
Test complete and conditional split export with modules.

... See full list

File

tests/src/Kernel/SplitTestTrait.php, line 62

Class

SplitTestTrait
Trait to facilitate creating split configurations.

Namespace

Drupal\Tests\config_split\Kernel

Code

protected function getSplitSourceStorage(Config $config) : StorageInterface {
  $directory = $config
    ->get('folder');
  if ($directory) {
    return new FileStorage($directory);
  }

  // We don't escape the name, it is tests after all.
  return new DatabaseStorage($this->container
    ->get('database'), strtr($config
    ->getName(), [
    '.' => '_',
  ]));
}