Refactor subscribers API to use updated captcha session

[MAILPOET-2343]
This commit is contained in:
Rostislav Wolny
2019-09-25 09:39:19 +02:00
committed by Jack Kitterhing
parent fa4c2c8b8f
commit de3c519fbf
2 changed files with 8 additions and 4 deletions

View File

@ -552,10 +552,13 @@ class SubscribersTest extends \MailPoetTest {
$subscriber->count_confirmations = 1;
$subscriber->save();
$captcha_value = 'ihg5w';
$captcha_session_id = 'abcdfgh';
$this->captcha_session->init($captcha_session_id);
$this->captcha_session->setCaptchaHash($captcha_value);
$response = $this->endpoint->subscribe([
$this->obfuscatedEmail => $email,
'form_id' => $this->form->id,
'captcha_session_id' => $captcha_session_id,
$this->obfuscatedSegments => [$this->segment_1->id, $this->segment_2->id],
'captcha' => $captcha_value,
]);