protected function SplitTestTrait::getSplitSourceStorage in Configuration Split 8
Same name and namespace in other branches
- 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.
File
- tests/
src/ Kernel/ SplitTestTrait.php, line 62
Class
- SplitTestTrait
- Trait to facilitate creating split configurations.
Namespace
Drupal\Tests\config_split\KernelCode
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(), [
'.' => '_',
]));
}