diff core/tests/Drupal/Tests/ConfigTestTrait.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents c75dbcec494b
children
line wrap: on
line diff
--- a/core/tests/Drupal/Tests/ConfigTestTrait.php	Thu Feb 28 13:11:55 2019 +0000
+++ b/core/tests/Drupal/Tests/ConfigTestTrait.php	Thu May 09 15:34:47 2019 +0100
@@ -4,6 +4,7 @@
 
 use Drupal\Core\Config\ConfigImporter;
 use Drupal\Core\Config\StorageComparer;
+use Drupal\Core\Config\StorageCopyTrait;
 use Drupal\Core\Config\StorageInterface;
 
 /**
@@ -11,6 +12,8 @@
  */
 trait ConfigTestTrait {
 
+  use StorageCopyTrait;
+
   /**
    * Returns a ConfigImporter object to import test configuration.
    *
@@ -22,8 +25,7 @@
       // Set up the ConfigImporter object for testing.
       $storage_comparer = new StorageComparer(
         $this->container->get('config.storage.sync'),
-        $this->container->get('config.storage'),
-        $this->container->get('config.manager')
+        $this->container->get('config.storage')
       );
       $this->configImporter = new ConfigImporter(
         $storage_comparer,
@@ -50,10 +52,7 @@
    *   The target config storage service.
    */
   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));
-    }
+    static::replaceStorageContents($source_storage, $target_storage);
   }
 
 }