Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / comment / tests / src / Kernel / Views / CommentLinksTest.php
index ffb91b0688747a1f4bb24162c23cdad8d9d50e29..08a326dde426d7cff72ec2dc0f6a6105e7700cdf 100644 (file)
@@ -18,6 +18,13 @@ use Drupal\views\Views;
  */
 class CommentLinksTest extends CommentViewsKernelTestBase {
 
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = ['entity_test'];
+
   /**
    * Views used by this test.
    *
@@ -25,15 +32,27 @@ class CommentLinksTest extends CommentViewsKernelTestBase {
    */
   public static $testViews = ['test_comment'];
 
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp($import_test_views = TRUE) {
+    parent::setUp($import_test_views);
+
+    $this->installEntitySchema('entity_test');
+  }
+
   /**
    * Test the comment approve link.
    */
   public function testLinkApprove() {
+    $host = EntityTest::create(['name' => $this->randomString()]);
+    $host->save();
 
     // Create an unapproved comment.
     $comment = $this->commentStorage->create([
       'uid' => $this->adminUser->id(),
       'entity_type' => 'entity_test',
+      'entity_id' => $host->id(),
       'comment_type' => 'entity_test',
       'status' => 0,
     ]);
@@ -91,8 +110,7 @@ class CommentLinksTest extends CommentViewsKernelTestBase {
    * Test the comment reply link.
    */
   public function testLinkReply() {
-    $this->enableModules(['field', 'entity_test']);
-    $this->installEntitySchema('entity_test');
+    $this->enableModules(['field']);
     $this->installSchema('comment', ['comment_entity_statistics']);
     $this->installConfig(['field']);