Add test to ensure HTTP_RANGE headers do not reload captcha
[MAILPOET-5032]
This commit is contained in:
@ -68,6 +68,22 @@ class CaptchaRendererTest extends \MailPoetTest {
|
|||||||
expect($firstCaptcha['phrase'])->notEquals($secondCaptcha['phrase']);
|
expect($firstCaptcha['phrase'])->notEquals($secondCaptcha['phrase']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* We need to ensure that a new captcha phrase is created when reloading
|
||||||
|
*/
|
||||||
|
public function testItDoesNotChangeCaptchaWhenAudioRangeHeaderChanges() {
|
||||||
|
$this->session->init();
|
||||||
|
$sessionId = $this->session->getId();
|
||||||
|
$fistAudio = $this->testee->renderAudio($sessionId, true);
|
||||||
|
$firstCaptcha = $this->session->getCaptchaHash();
|
||||||
|
$_SERVER['HTTP_RANGE'] = 'bytes:0-1';
|
||||||
|
$secondAudio = $this->testee->renderAudio($sessionId, true);
|
||||||
|
$secondCaptcha = $this->session->getCaptchaHash();
|
||||||
|
unset($_SERVER['HTTP_RANGE']);
|
||||||
|
expect($fistAudio)->Equals($secondAudio);
|
||||||
|
expect($firstCaptcha['phrase'])->Equals($secondCaptcha['phrase']);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We need to make sure that the audio presented to a listener plays the same captcha
|
* We need to make sure that the audio presented to a listener plays the same captcha
|
||||||
* the image shows.
|
* the image shows.
|
||||||
|
Reference in New Issue
Block a user