protected function CaptchaAdminTest::assertCaptchaSetting in CAPTCHA 8
Helper function for checking CAPTCHA setting of a form.
Parameters
string $form_id: The form_id of the form to investigate.
string $challenge_type: What the challenge type should be: NULL, 'default' or something like 'captcha/Math'.
1 call to CaptchaAdminTest::assertCaptchaSetting()
- CaptchaAdminTest::testCaptchaAdminLinks in tests/
src/ Functional/ CaptchaAdminTest.php - Testing of the CAPTCHA administration links.
File
- tests/
src/ Functional/ CaptchaAdminTest.php, line 95
Class
- CaptchaAdminTest
- Tests CAPTCHA admin settings.
Namespace
Drupal\Tests\captcha\FunctionalCode
protected function assertCaptchaSetting($form_id, $challenge_type) {
$result = captcha_get_form_id_setting(self::COMMENT_FORM_ID, TRUE);
$this
->assertEquals($result, $challenge_type, $this
->t('Check CAPTCHA setting for form: expected: @expected, received: @received.', [
'@expected' => var_export($challenge_type, TRUE),
'@received' => var_export($result, TRUE),
]));
}