CommentRSSUnitTest::testCommentRSS

7 comment.test CommentRSSUnitTest::testCommentRSS()
8 comment.test CommentRSSUnitTest::testCommentRSS()

Test comments as part of an RSS feed.

File

modules/comment/comment.test, line 1771
Tests for comment.module.

Code

function testCommentRSS() {
  // Find comment in RSS feed.
  $this->drupalLogin($this->web_user);
  $comment = $this->postComment($this->node, $this->randomName(), $this->randomName());
  $this->drupalGet('rss.xml');
  $raw = '<comments>' . url('node/' . $this->node->nid, array('fragment' => 'comments', 'absolute' => TRUE)) . '</comments>';
  $this->assertRaw($raw, t('Comments as part of RSS feed.'));

  // Hide comments from RSS feed and check presence.
  $this->node->comment = COMMENT_NODE_HIDDEN;
  node_save($this->node);
  $this->drupalGet('rss.xml');
  $this->assertNoRaw($raw, t('Hidden comments is not a part of RSS feed.'));
}
Login or register to post comments