function CaptchaTestCase::testCaseInsensitiveValidation in CAPTCHA 7
Same name and namespace in other branches
- 6.2 captcha.test \CaptchaTestCase::testCaseInsensitiveValidation()
File
- ./captcha.test, line 310
- Tests for CAPTCHA module.
Class
- CaptchaTestCase
Code
function testCaseInsensitiveValidation() {
captcha_set_form_id_setting(self::COMMENT_FORM_ID, 'captcha/Test');
$this
->drupalLogin($this->normal_user);
variable_set('captcha_default_validation', CAPTCHA_DEFAULT_VALIDATION_CASE_SENSITIVE);
$this
->assertCommentPosting('Test 123', TRUE, 'Case sensitive validation of right casing.');
$this
->assertCommentPosting('test 123', FALSE, 'Case sensitive validation of wrong casing.');
$this
->assertCommentPosting('TEST 123', FALSE, 'Case sensitive validation of wrong casing.');
variable_set('captcha_default_validation', CAPTCHA_DEFAULT_VALIDATION_CASE_INSENSITIVE);
$this
->assertCommentPosting('Test 123', TRUE, 'Case insensitive validation of right casing.');
$this
->assertCommentPosting('test 123', TRUE, 'Case insensitive validation of wrong casing.');
$this
->assertCommentPosting('TEST 123', TRUE, 'Case insensitive validation of wrong casing.');
}