c28be63b977ed60da6c5c8f8498a3a8859f24706
[yaffs-website] / web / core / modules / comment / tests / src / Kernel / Migrate / d6 / MigrateCommentTypeTest.php
1 <?php
2
3 namespace Drupal\Tests\comment\Kernel\Migrate\d6;
4
5 use Drupal\comment\Entity\CommentType;
6 use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
7
8 /**
9  * Upgrade comment type.
10  *
11  * @group migrate_drupal_6
12  */
13 class MigrateCommentTypeTest extends MigrateDrupal6TestBase {
14
15   /**
16    * {@inheritdoc}
17    */
18   public static $modules = ['comment'];
19
20   /**
21    * {@inheritdoc}
22    */
23   protected function setUp() {
24     parent::setUp();
25     $this->installEntitySchema('node');
26     $this->installEntitySchema('comment');
27     $this->installConfig(['node', 'comment']);
28     $this->executeMigration('d6_comment_type');
29   }
30
31   /**
32    * Tests the Drupal 6 to Drupal 8 comment type migration.
33    */
34   public function testCommentType() {
35     $comment_type = CommentType::load('comment');
36     $this->assertIdentical('node', $comment_type->getTargetEntityTypeId());
37     $comment_type = CommentType::load('comment_no_subject');
38     $this->assertIdentical('node', $comment_type->getTargetEntityTypeId());
39   }
40
41 }