You are here

function BotchaAdminTestCase::testAdminAccess in BOTCHA Spam Prevention 7

Same name and namespace in other branches
  1. 6 botcha.test \BotchaAdminTestCase::testAdminAccess()

Test access to the admin pages.

File

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

Class

BotchaAdminTestCase

Code

function testAdminAccess() {
  $this
    ->drupalLogin($this->normal_user);
  $this
    ->drupalGet(self::BOTCHA_ADMIN_PATH);
  file_put_contents('tmp.simpletest.html', $this
    ->drupalGetContent());
  $this
    ->assertText(t('Access denied'), 'Normal users should not be able to access the BOTCHA admin pages', 'BOTCHA');
  $this
    ->drupalLogin($this->admin_user);
  $this
    ->drupalGet(self::BOTCHA_ADMIN_PATH);
  $this
    ->assertNoText(t('Access denied'), 'Admin users should be able to access the BOTCHA admin pages', 'BOTCHA');
}