You are here

protected function CaptchaBaseWebTestCase::allowCommentPostingForAnonymousVisitors in CAPTCHA 6.2

Same name and namespace in other branches
  1. 7 captcha.test \CaptchaBaseWebTestCase::allowCommentPostingForAnonymousVisitors()

Helper function to allow comment posting for anonymous users.

1 call to CaptchaBaseWebTestCase::allowCommentPostingForAnonymousVisitors()
CaptchaSessionReuseAttackTestCase::testMultipleCaptchaProtectedFormsOnOnePage in ./captcha.test

File

./captcha.test, line 191
Tests for CAPTCHA module.

Class

CaptchaBaseWebTestCase
Base class for CAPTCHA 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[post comments without approval]' => true,
  );
  $this
    ->drupalPost('admin/user/permissions', $edit, 'Save permissions');
  $this
    ->assertText('The changes have been saved.');

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