public function TestBase::copyConfig

Copies configuration objects from source storage to target storage.

Parameters

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

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

6 calls to TestBase::copyConfig()
ConfigImporterTest::setUp in drupal/core/modules/config/lib/Drupal/config/Tests/ConfigImporterTest.php
Sets up Drupal unit test environment.
ConfigImportUITest::setUp in drupal/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php
Sets up a Drupal site for running functional and integration tests.
FieldImportChangeTest::testImportChange in drupal/core/modules/field/lib/Drupal/field/Tests/FieldImportChangeTest.php
Tests importing an updated field instance.
FieldImportCreateTest::testImportCreate in drupal/core/modules/field/lib/Drupal/field/Tests/FieldImportCreateTest.php
Tests creating fields and instances during config import.
FieldImportDeleteTest::testImportDelete in drupal/core/modules/field/lib/Drupal/field/Tests/FieldImportDeleteTest.php
Tests deleting fields and instances as part of config import.

... See full list

File

drupal/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php, line 1323
Definition of Drupal\simpletest\TestBase.

Class

TestBase
Base class for Drupal tests.

Namespace

Drupal\simpletest

Code

public 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));
  }
}