You are here

protected function BotchaBaseWebTestCase::allowCommentPostingForAnonymousVisitors in BOTCHA Spam Prevention 7.2

Same name and namespace in other branches
  1. 6 botcha.test \BotchaBaseWebTestCase::allowCommentPostingForAnonymousVisitors()
  2. 6.2 botcha.test \BotchaBaseWebTestCase::allowCommentPostingForAnonymousVisitors()
  3. 6.3 tests/botcha.simpletest.test \BotchaBaseWebTestCase::allowCommentPostingForAnonymousVisitors()
  4. 7 botcha.test \BotchaBaseWebTestCase::allowCommentPostingForAnonymousVisitors()
  5. 7.3 tests/botcha.simpletest.test \BotchaBaseWebTestCase::allowCommentPostingForAnonymousVisitors()

Helper function to allow comment posting for anonymous users.

1 call to BotchaBaseWebTestCase::allowCommentPostingForAnonymousVisitors()
BotchaTestCase::setUp in ./botcha.test
Sets up a Drupal site for running functional and integration tests.

File

./botcha.test, line 214
Tests for BOTCHA module.

Class

BotchaBaseWebTestCase
Base class for BOTCHA tests.

Code

protected function allowCommentPostingForAnonymousVisitors() {

  // Log in as admin.
  $this
    ->drupalLogin($this->admin_user);

  // Post user permissions form
  $edit = array(
    '1[access comments]' => TRUE,
    '1[post comments]' => TRUE,
    '1[skip comment approval]' => TRUE,
  );
  $this
    ->drupalPost('admin/people/permissions', $edit, 'Save permissions');
  $this
    ->assertText('The changes have been saved.');

  // Log admin out
  $this
    ->drupalLogout();
}