function CommentAuthorDeletionTestCase::testAuthorDeletionCommentModuleDisabled

Test comment author deletion while the comment module is disabled.

File

modules/comment/comment.test, line 2368

Class

CommentAuthorDeletionTestCase
Tests the behavior of comments when the comment author is deleted.

Code

function testAuthorDeletionCommentModuleDisabled() {
    // Create a comment as the admin user.
    $this->drupalLogin($this->admin_user);
    $comment = $this->postComment($this->node, $this->randomName());
    $this->assertTrue($this->commentExists($comment), t('Comment is displayed initially.'));
    $this->drupalLogout();
    // Delete the admin user while the comment module is disabled, and ensure
    // that the missing comment author is still handled correctly (the node
    // itself should be displayed, but the comment should not be displayed on
    // it).
    module_disable(array(
        'comment',
    ));
    user_delete($this->admin_user->uid);
    module_enable(array(
        'comment',
    ));
    $this->drupalGet('node/' . $this->node->nid);
    $this->assertResponse(200, t('Node page is accessible after the comment author is deleted.'));
    $this->assertFalse($this->commentExists($comment), t('Comment is not displayed after the comment author is deleted.'));
}

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