Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / modules / contrib / migrate_plus / tests / src / Kernel / MigrationGroupTest.php
index 4cdd55253b5b8d1bfe82a1cce9ddc3b4e901f2dd..53d3ad467d52104f626c74b256e539a0c4a5d087 100644 (file)
@@ -5,7 +5,6 @@ namespace Drupal\Tests\migrate_plus\Kernel;
 use Drupal\KernelTests\KernelTestBase;
 use Drupal\migrate_plus\Entity\Migration;
 use Drupal\migrate_plus\Entity\MigrationGroup;
-use Drupal\migrate_plus\Entity\MigrationGroupInterface;
 
 /**
  * Test migration groups.
@@ -22,18 +21,22 @@ class MigrationGroupTest extends KernelTestBase {
   public function testConfigurationMerge() {
     $group_id = 'test_group';
 
-    /** @var MigrationGroupInterface $migration_group */
+    /** @var \Drupal\migrate_plus\Entity\MigrationGroupInterface $migration_group */
     $group_configuration = [
       'id' => $group_id,
       'shared_configuration' => [
-        'migration_tags' => ['Drupal 6'], // In migration, so will be overridden.
+        // In migration, so will be overridden.
+        'migration_tags' => ['Drupal 6'],
         'source' => [
           'constants' => [
-            'type' => 'image',    // Not in migration, so will be added.
-            'cardinality' => '1', // In migration, so will be overridden.
+            // Not in migration, so will be added.
+            'type' => 'image',
+            // In migration, so will be overridden.
+            'cardinality' => '1',
           ],
         ],
-        'destination' => ['plugin' => 'field_storage_config'], // Not in migration, so will be added.
+        // Not in migration, so will be added.
+        'destination' => ['plugin' => 'field_storage_config'],
       ],
     ];
     $this->container->get('entity_type.manager')->getStorage('migration_group')
@@ -42,21 +45,25 @@ class MigrationGroupTest extends KernelTestBase {
     /** @var \Drupal\migrate_plus\Entity\MigrationInterface $migration */
     $migration = $this->container->get('entity_type.manager')
       ->getStorage('migration')->create([
-      'id' => 'specific_migration',
-      'load' => [],
-      'migration_group' => $group_id,
-      'label' => 'Unaffected by the group',
-      'migration_tags' => ['Drupal 7'], // Overrides group.
-      'destination' => [],
-      'source' => [],
-      'process' => [],
-      'migration_dependencies' => [],
-    ]);
+        'id' => 'specific_migration',
+        'load' => [],
+        'migration_group' => $group_id,
+        'label' => 'Unaffected by the group',
+          // Overrides group.
+        'migration_tags' => ['Drupal 7'],
+        'destination' => [],
+        'source' => [],
+        'process' => [],
+        'migration_dependencies' => [],
+      ]);
     $migration->set('source', [
-      'plugin' => 'empty',        // Not in group, persists.
+      // Not in group, persists.
+      'plugin' => 'empty',
       'constants' => [
-        'entity_type' => 'user',  // Not in group, persists.
-        'cardinality' => '3',     // Overrides group.
+        // Not in group, persists.
+        'entity_type' => 'user',
+        // Overrides group.
+        'cardinality' => '3',
       ],
     ]);
     $migration->save();
@@ -88,7 +95,7 @@ class MigrationGroupTest extends KernelTestBase {
    * Test that deleting a group deletes its migrations.
    */
   public function testDelete() {
-    /** @var MigrationGroupInterface $migration_group */
+    /** @var \Drupal\migrate_plus\Entity\MigrationGroupInterface $migration_group */
     $group_configuration = [
       'id' => 'test_group',
     ];
@@ -99,14 +106,14 @@ class MigrationGroupTest extends KernelTestBase {
     /** @var \Drupal\migrate_plus\Entity\MigrationInterface $migration */
     $migration = $this->container->get('entity_type.manager')
       ->getStorage('migration')->create([
-      'id' => 'specific_migration',
-      'migration_group' => 'test_group',
-      'migration_tags' => [],
-      'load' => [],
-      'destination' => [],
-      'source' => [],
-      'migration_dependencies' => [],
-    ]);
+        'id' => 'specific_migration',
+        'migration_group' => 'test_group',
+        'migration_tags' => [],
+        'load' => [],
+        'destination' => [],
+        'source' => [],
+        'migration_dependencies' => [],
+      ]);
     $migration->save();
 
     /** @var \Drupal\migrate_plus\Entity\MigrationGroupInterface $loaded_migration_group */