1 comment.test CommentRSSUnitTest::testCommentRSS()

Tests comments as part of an RSS feed.

File

core/modules/comment/tests/comment.test, line 1879
Tests for the Comment module.

Class

CommentRSSUnitTest
Unit tests for Comment module integration with RSS feeds.

Code

function testCommentRSS() {
  // Find comment in RSS feed.
  $this->backdropLogin($this->web_user);
  $comment = $this->postComment($this->node, $this->randomName(), $this->randomName());
  $this->backdropGet('rss.xml');
  $raw = '<comments>' . url('node/' . $this->node->nid, array('fragment' => 'comments', 'absolute' => TRUE)) . '</comments>';
  $this->assertRaw($raw, '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->backdropGet('rss.xml');
  $this->assertNoRaw($raw, 'Hidden comments is not a part of RSS feed.');
}