diff --git a/core/modules/comment/src/Tests/CommentTypeTest.php b/core/modules/comment/src/Tests/CommentTypeTest.php
index fb5028f..6bbfdaa 100644
--- a/core/modules/comment/src/Tests/CommentTypeTest.php
+++ b/core/modules/comment/src/Tests/CommentTypeTest.php
@@ -187,4 +187,15 @@ public function testCommentTypeDeletion() {
     $this->assertRaw(t('The comment type %label has been deleted.', array('%label' => $type->label())));
   }
 
+  /**
+   * Tests that the module providing the target entity is listed as a dependency
+   */
+  public function testCalculateDependencies() {
+
+    // Create a comment type programmatically.
+    $type = $this->createCommentType('dep_test');
+    $target_entity_type = \Drupal::entityTypeManager()->getDefinition($type->getTargetEntityTypeId());
+    $dependencies = $type->calculateDependencies()->getDependencies();
+    $this->assertTrue(in_array($target_entity_type->getProvider(), $dependencies['module']), 'Module dependency was found.');
+  }
 }
