function BotchaAdminTestCase::testAdminAccess in BOTCHA Spam Prevention 6
Same name and namespace in other branches
- 7 botcha.test \BotchaAdminTestCase::testAdminAccess()
Test access to the admin pages.
File
- ./
botcha.test, line 491 - Tests for BOTCHA module.
Class
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');
}