function BotchaSessionReuseAttackTestCase::testBotchaSessionReuseAttackDetectionOnLoginForm in BOTCHA Spam Prevention 6
Same name and namespace in other branches
- 7 botcha.test \BotchaSessionReuseAttackTestCase::testBotchaSessionReuseAttackDetectionOnLoginForm()
File
- ./botcha.test, line 965
- Tests for BOTCHA module.
Class
- BotchaSessionReuseAttackTestCase
Code
function testBotchaSessionReuseAttackDetectionOnLoginForm() {
botcha_set_form_id_setting('user_login', 'test');
$this
->drupalGet('user');
$this
->assertBotchaPresence(TRUE);
$form_build_id = $this
->getFormBuildIdFromForm();
$edit = array(
'name' => $this->normal_user->name,
'pass' => $this->normal_user->pass_raw,
);
$this
->drupalPost(NULL, $edit, t('Log in'));
$this
->assertBotchaResponseAccepted();
$this
->assertBotchaPresence(FALSE);
$pass = $this
->assertLink(t('Log out'), 0, t('User %name successfully logged in.', array(
'%name' => $this->normal_user->name,
)), t('User login'));
$this
->drupalLogout();
$edit += array(
'form_build_id' => $form_build_id,
);
$this
->drupalPost('user', $edit, t('Log in'));
$this
->assertBotchaSessionIdReuseAttackDetection();
$this
->assertBotchaPresence(TRUE);
}