Version 1
[yaffs-website] / web / core / modules / comment / tests / src / Kernel / Migrate / d6 / MigrateCommentTypeTest.php
diff --git a/web/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentTypeTest.php b/web/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentTypeTest.php
new file mode 100644 (file)
index 0000000..c28be63
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+
+namespace Drupal\Tests\comment\Kernel\Migrate\d6;
+
+use Drupal\comment\Entity\CommentType;
+use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
+
+/**
+ * Upgrade comment type.
+ *
+ * @group migrate_drupal_6
+ */
+class MigrateCommentTypeTest extends MigrateDrupal6TestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public static $modules = ['comment'];
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+    $this->installEntitySchema('node');
+    $this->installEntitySchema('comment');
+    $this->installConfig(['node', 'comment']);
+    $this->executeMigration('d6_comment_type');
+  }
+
+  /**
+   * Tests the Drupal 6 to Drupal 8 comment type migration.
+   */
+  public function testCommentType() {
+    $comment_type = CommentType::load('comment');
+    $this->assertIdentical('node', $comment_type->getTargetEntityTypeId());
+    $comment_type = CommentType::load('comment_no_subject');
+    $this->assertIdentical('node', $comment_type->getTargetEntityTypeId());
+  }
+
+}