function CommentRSSUnitTest::testCommentRSS

Test comments as part of an RSS feed.

File

modules/comment/comment.test, line 1793

Class

CommentRSSUnitTest
Unit tests for comment module integration with RSS feeds.

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, '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, 'Hidden comments is not a part of RSS feed.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.