3 namespace Drupal\comment\Tests;
6 * Tests comment links altering.
10 class CommentLinksAlterTest extends CommentTestBase {
12 public static $modules = ['comment_test'];
14 protected function setUp() {
17 // Enable comment_test.module's hook_comment_links_alter() implementation.
18 $this->container->get('state')->set('comment_test_links_alter_enabled', TRUE);
22 * Tests comment links altering.
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);
30 $this->drupalGet('node/' . $this->node->id());
32 $this->assertLink(t('Report'));