X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fcomment%2Ftests%2Fsrc%2FKernel%2FMigrate%2Fd6%2FMigrateCommentFieldTest.php;fp=web%2Fcore%2Fmodules%2Fcomment%2Ftests%2Fsrc%2FKernel%2FMigrate%2Fd6%2FMigrateCommentFieldTest.php;h=e08e2d2e20ab6d1873c0a9d92bc0aed1f4b49990;hp=0000000000000000000000000000000000000000;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/web/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentFieldTest.php b/web/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentFieldTest.php new file mode 100644 index 000000000..e08e2d2e2 --- /dev/null +++ b/web/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentFieldTest.php @@ -0,0 +1,65 @@ +installConfig(['comment']); + $this->executeMigrations([ + 'd6_comment_type', + 'd6_comment_field', + ]); + } + + /** + * Asserts a comment field entity. + * + * @param string $comment_type + * The comment type. + */ + protected function assertEntity($comment_type) { + $entity = FieldStorageConfig::load('node.' . $comment_type); + $this->assertInstanceOf(FieldStorageConfig::class, $entity); + $this->assertSame('node', $entity->getTargetEntityTypeId()); + $this->assertSame('comment', $entity->getType()); + $this->assertSame($comment_type, $entity->getSetting('comment_type')); + } + + /** + * Tests the migrated comment fields. + */ + public function testMigration() { + $this->assertEntity('comment_node_article'); + $this->assertEntity('comment_node_company'); + $this->assertEntity('comment_node_employee'); + $this->assertEntity('comment_node_event'); + $this->assertEntity('comment_forum'); + $this->assertEntity('comment_node_page'); + $this->assertEntity('comment_node_sponsor'); + $this->assertEntity('comment_node_story'); + $this->assertEntity('comment_node_test_event'); + $this->assertEntity('comment_node_test_page'); + $this->assertEntity('comment_node_test_planet'); + $this->assertEntity('comment_node_test_story'); + } + +}