Add integration test for unauthorized email

[MAILPOET-1787]
This commit is contained in:
Ján Mikláš
2019-02-19 14:17:46 +01:00
committed by M. Shull
parent 1da2263d83
commit 79bd178123
2 changed files with 16 additions and 0 deletions

View File

@ -59,6 +59,20 @@ class MailPoetMapperTest extends \MailPoetTest {
));
}
function testGetErrorUnauthorizedEmail() {
$api_result = [
'code' => API::RESPONSE_CODE_CAN_NOT_SEND,
'status' => API::SENDING_STATUS_SEND_ERROR,
'message' => MailerError::MESSAGE_EMAIL_NOT_AUTHORIZED,
];
$error = $this->mapper->getErrorForResult($api_result, $this->subscribers);
expect($error)->isInstanceOf(MailerError::class);
expect($error->getOperation())->equals(MailerError::OPERATION_SEND);
expect($error->getLevel())->equals(MailerError::LEVEL_HARD);
expect($error->getMessage())->contains('The MailPoet Sending Service did not send your latest email because the address');
}
function testGetErrorPayloadTooBig() {
$api_result = [
'code' => API::RESPONSE_CODE_PAYLOAD_TOO_BIG,