Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / comment / tests / src / Functional / Views / CommentEditTest.php
diff --git a/web/core/modules/comment/tests/src/Functional/Views/CommentEditTest.php b/web/core/modules/comment/tests/src/Functional/Views/CommentEditTest.php
new file mode 100644 (file)
index 0000000..fb5f736
--- /dev/null
@@ -0,0 +1,37 @@
+<?php
+
+namespace Drupal\Tests\comment\Functional\Views;
+
+use Drupal\Tests\comment\Functional\CommentTestBase as CommentBrowserTestBase;
+
+/**
+ * Tests comment edit functionality.
+ *
+ * @group comment
+ */
+class CommentEditTest extends CommentBrowserTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected $profile = 'standard';
+
+  /**
+   * Tests comment label in admin view.
+   */
+  public function testCommentEdit() {
+    $this->drupalLogin($this->adminUser);
+    // Post a comment to node.
+    $node_comment = $this->postComment($this->node, $this->randomMachineName(), $this->randomMachineName(), TRUE);
+    $this->drupalGet('admin/content/comment');
+    $this->assertText($this->adminUser->label());
+    $this->drupalGet($node_comment->toUrl('edit-form'));
+    $edit = [
+      'comment_body[0][value]' => $this->randomMachineName(),
+    ];
+    $this->drupalPostForm(NULL, $edit, t('Save'));
+    $this->drupalGet('admin/content/comment');
+    $this->assertText($this->adminUser->label());
+  }
+
+}