You are here

protected function BotchaBaseWebTestCase::allowCommentPostingForAnonymousVisitors in BOTCHA Spam Prevention 6.2

Same name and namespace in other branches
  1. 6 botcha.test \BotchaBaseWebTestCase::allowCommentPostingForAnonymousVisitors()
  2. 6.3 tests/botcha.simpletest.test \BotchaBaseWebTestCase::allowCommentPostingForAnonymousVisitors()
  3. 7 botcha.test \BotchaBaseWebTestCase::allowCommentPostingForAnonymousVisitors()
  4. 7.2 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
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…

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,
    // @todo Abstract it.

    //'1[skip comment approval]' => TRUE,
    '1[post comments without approval]' => TRUE,
  );

  // @todo Abstract it.

  //$this->drupalPost('admin/config/people/permissions', $edit, 'Save permissions');
  $this
    ->drupalPost('admin/user/permissions', $edit, 'Save permissions');
  $this
    ->assertText('The changes have been saved.');

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