You are here

protected function KernelTestBase::copyConfig in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/KernelTests/KernelTestBase.php \Drupal\KernelTests\KernelTestBase::copyConfig()

Copies configuration objects from a source storage to a target storage.

@todo Move into Config-specific test base class.

Parameters

\Drupal\Core\Config\StorageInterface $source_storage: The source config storage.

\Drupal\Core\Config\StorageInterface $target_storage: The target config storage.

File

core/tests/Drupal/KernelTests/KernelTestBase.php, line 976
Contains \Drupal\KernelTests\KernelTestBase.

Class

KernelTestBase
Base class for functional integration tests.

Namespace

Drupal\KernelTests

Code

protected function copyConfig(StorageInterface $source_storage, StorageInterface $target_storage) {
  $target_storage
    ->deleteAll();
  foreach ($source_storage
    ->listAll() as $name) {
    $target_storage
      ->write($name, $source_storage
      ->read($name));
  }
}