db backup prior to drupal security update
[yaffs-website] / web / core / modules / comment / src / Tests / CommentLinksAlterTest.php
1 <?php
2
3 namespace Drupal\comment\Tests;
4
5 /**
6  * Tests comment links altering.
7  *
8  * @group comment
9  */
10 class CommentLinksAlterTest extends CommentTestBase {
11
12   public static $modules = ['comment_test'];
13
14   protected function setUp() {
15     parent::setUp();
16
17     // Enable comment_test.module's hook_comment_links_alter() implementation.
18     $this->container->get('state')->set('comment_test_links_alter_enabled', TRUE);
19   }
20
21   /**
22    * Tests comment links altering.
23    */
24   public function testCommentLinksAlter() {
25     $this->drupalLogin($this->webUser);
26     $comment_text = $this->randomMachineName();
27     $subject = $this->randomMachineName();
28     $comment = $this->postComment($this->node, $comment_text, $subject);
29
30     $this->drupalGet('node/' . $this->node->id());
31
32     $this->assertLink(t('Report'));
33   }
34
35 }