protected function SplitTestTrait::getSplitSourceStorage in Configuration Split 2.0.x
Same name and namespace in other branches
- 8 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()
- InactiveSplitTest::testActiveInactive in tests/
src/ Kernel/ InactiveSplitTest.php - Test.
- 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.
File
- tests/
src/ Kernel/ SplitTestTrait.php, line 63
Class
- SplitTestTrait
- Trait to facilitate creating split configurations.
Namespace
Drupal\Tests\config_split\KernelCode
protected function getSplitSourceStorage(Config $config) : StorageInterface {
switch ($config
->get('storage')) {
case 'folder':
return new FileStorage($config
->get('folder'));
case 'collection':
return new SplitCollectionStorage($this
->getSyncFileStorage(), $config
->get('id'));
case 'database':
// We don't escape the name, it is tests after all.
return new DatabaseStorage($this->container
->get('database'), strtr($config
->getName(), [
'.' => '_',
]));
}
throw new \LogicException();
}