Add code to display the invisible ReCaptcha in the frontend
This commit adds the required code to display the invisible ReCaptcha in the frontend when a form is rendered and this type of captcha is selected in the admin. [MAILPOET-4145]
This commit is contained in:
@@ -697,6 +697,18 @@ class SubscribersTest extends \MailPoetTest {
|
||||
$this->settings->set('captcha', []);
|
||||
}
|
||||
|
||||
public function testItCannotSubscribeWithoutInvisibleReCaptchaWhenEnabled() {
|
||||
$this->settings->set('captcha', ['type' => Captcha::TYPE_RECAPTCHA_INVISIBLE]);
|
||||
$response = $this->endpoint->subscribe([
|
||||
$this->obfuscatedEmail => 'toto@mailpoet.com',
|
||||
'form_id' => $this->form->getId(),
|
||||
$this->obfuscatedSegments => [$this->segment1->getId(), $this->segment2->getId()],
|
||||
]);
|
||||
expect($response->status)->equals(APIResponse::STATUS_BAD_REQUEST);
|
||||
expect($response->errors[0]['message'])->equals('Please check the CAPTCHA.');
|
||||
$this->settings->set('captcha', []);
|
||||
}
|
||||
|
||||
public function testItCannotSubscribeWithoutBuiltInCaptchaWhenEnabled() {
|
||||
$this->settings->set('captcha', ['type' => Captcha::TYPE_BUILTIN]);
|
||||
$email = 'toto@mailpoet.com';
|
||||
|
Reference in New Issue
Block a user