Mercurial > hg > cmmr2012-drupal-site
annotate core/modules/comment/tests/src/Functional/CommentLinksAlterTest.php @ 0:c75dbcec494b
Initial commit from drush-created site
author | Chris Cannam |
---|---|
date | Thu, 05 Jul 2018 14:24:15 +0000 |
parents | |
children |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 namespace Drupal\Tests\comment\Functional; |
Chris@0 | 4 |
Chris@0 | 5 /** |
Chris@0 | 6 * Tests comment links altering. |
Chris@0 | 7 * |
Chris@0 | 8 * @group comment |
Chris@0 | 9 */ |
Chris@0 | 10 class CommentLinksAlterTest extends CommentTestBase { |
Chris@0 | 11 |
Chris@0 | 12 public static $modules = ['comment_test']; |
Chris@0 | 13 |
Chris@0 | 14 protected function setUp() { |
Chris@0 | 15 parent::setUp(); |
Chris@0 | 16 |
Chris@0 | 17 // Enable comment_test.module's hook_comment_links_alter() implementation. |
Chris@0 | 18 $this->container->get('state')->set('comment_test_links_alter_enabled', TRUE); |
Chris@0 | 19 } |
Chris@0 | 20 |
Chris@0 | 21 /** |
Chris@0 | 22 * Tests comment links altering. |
Chris@0 | 23 */ |
Chris@0 | 24 public function testCommentLinksAlter() { |
Chris@0 | 25 $this->drupalLogin($this->webUser); |
Chris@0 | 26 $comment_text = $this->randomMachineName(); |
Chris@0 | 27 $subject = $this->randomMachineName(); |
Chris@0 | 28 $comment = $this->postComment($this->node, $comment_text, $subject); |
Chris@0 | 29 |
Chris@0 | 30 $this->drupalGet('node/' . $this->node->id()); |
Chris@0 | 31 |
Chris@0 | 32 $this->assertLink(t('Report')); |
Chris@0 | 33 } |
Chris@0 | 34 |
Chris@0 | 35 } |