You are here

protected function CaptchaBaseWebTestCase::allowCommentPostingForAnonymousVisitors in CAPTCHA 7

Same name and namespace in other branches
  1. 6.2 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 199
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[skip comment approval]' => true,
  );
  $this
    ->drupalPost('admin/people/permissions', $edit, 'Save permissions');
  $this
    ->assertText('The changes have been saved.');

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