fb5f736a870fa25640386502545ee3b34b0efa78
[yaffs-website] / web / core / modules / comment / tests / src / Functional / Views / CommentEditTest.php
1 <?php
2
3 namespace Drupal\Tests\comment\Functional\Views;
4
5 use Drupal\Tests\comment\Functional\CommentTestBase as CommentBrowserTestBase;
6
7 /**
8  * Tests comment edit functionality.
9  *
10  * @group comment
11  */
12 class CommentEditTest extends CommentBrowserTestBase {
13
14   /**
15    * {@inheritdoc}
16    */
17   protected $profile = 'standard';
18
19   /**
20    * Tests comment label in admin view.
21    */
22   public function testCommentEdit() {
23     $this->drupalLogin($this->adminUser);
24     // Post a comment to node.
25     $node_comment = $this->postComment($this->node, $this->randomMachineName(), $this->randomMachineName(), TRUE);
26     $this->drupalGet('admin/content/comment');
27     $this->assertText($this->adminUser->label());
28     $this->drupalGet($node_comment->toUrl('edit-form'));
29     $edit = [
30       'comment_body[0][value]' => $this->randomMachineName(),
31     ];
32     $this->drupalPostForm(NULL, $edit, t('Save'));
33     $this->drupalGet('admin/content/comment');
34     $this->assertText($this->adminUser->label());
35   }
36
37 }