diff --git a/core/modules/forum/src/Tests/ForumIndexTest.php b/core/modules/forum/src/Tests/ForumIndexTest.php index 88a6f1b..9b95037 100644 --- a/core/modules/forum/src/Tests/ForumIndexTest.php +++ b/core/modules/forum/src/Tests/ForumIndexTest.php @@ -17,14 +17,14 @@ class ForumIndexTest extends WebTestBase { /** - * User account with limited access to forum pages + * User account with access to create forum topics. * * @var \Drupal\Core\Session\AccountInterface */ protected $webUser; /** - * User account with limited access to forum pages + * User account with access to create replies in a forum topic. * * @var \Drupal\Core\Session\AccountInterface */ @@ -40,7 +40,6 @@ class ForumIndexTest extends WebTestBase { protected function setUp() { parent::setUp(); - // Create a test user. $this->webUser = $this->drupalCreateUser(array('create forum content', 'edit own forum content', 'edit any forum content', 'administer nodes')); $this->forumUser = $this->drupalCreateUser(array('create forum content', 'edit own forum content', 'edit any forum content', 'administer nodes', 'administer comments', 'post comments', 'skip comment approval')); } @@ -101,24 +100,23 @@ public function testHistory() { $this->clickLink(t('Add new @node_type', array('@node_type' => 'Forum topic'))); $this->drupalPostForm(NULL, $edit, t('Save and publish')); - // Login as the forum user to create a reply + // Login as the forum user to create a reply. $this->drupalLogin($this->forumUser); - // Mockup a comment + // Create a comment. $edit = array(); $edit['comment_body[0][value]'] = $this->randomMachineName(); - // Create comment $this->drupalGet("forum/$tid"); $this->clickLink(t($title)); $this->drupalPostForm(NULL, $edit, t('Save')); - // Verify the new post link is not raw + // Verify the new post message link is not escaped. $this->drupalLogin($this->webUser); $this->drupalGet("forum/$tid"); $xpath = $this->buildXPathQuery('//td[@class="forum__replies"]/a/span[@class="visually-hidden"]'); $new_replies_message = $this->xpath($xpath); $this->assertTrue(!empty($new_replies_message), "The new replies message was found."); } -} +}