You are here

function CommentModuleTestCase::set_anonymous_user_comment in SimpleTest 6

Set anonymous comment setting.

Parameters

boolean $enabled Allow anonymous commenting.:

boolean $without_approval Allow anonymous commenting without approval.:

1 call to CommentModuleTestCase::set_anonymous_user_comment()
CommentModuleTestCase::testAnonymous in tests/comment_module.test
Test anonymous comment functionality.

File

tests/comment_module.test, line 324

Class

CommentModuleTestCase

Code

function set_anonymous_user_comment($enabled, $without_approval) {
  $edit = array();
  $edit['1-access-comments'] = $enabled;
  $edit['1-post-comments'] = $enabled;
  $edit['1-post-comments-without-approval'] = $without_approval;
  $this
    ->drupalPost('admin/user/permissions', $edit, 'Save permissions');
  $this
    ->assertText(t('The changes have been saved.'), 'Anonymous user comments ' . ($enabled ? 'enabled' : 'disabled') . '.');
}