Move current unit tests to integration tests

This commit is contained in:
wxa
2018-10-17 13:27:34 +03:00
parent b21ef30202
commit 87e515b89d
175 changed files with 0 additions and 0 deletions

View File

@ -1,36 +0,0 @@
<?php
namespace MailPoet\Test\Mailer\Methods\ErrorMappers;
use MailPoet\Mailer\MailerError;
use MailPoet\Mailer\Methods\ErrorMappers\SendGridMapper;
class SendGridMapperTest extends \MailPoetTest {
/** @var SendGridMapper*/
private $mapper;
/** @var array */
private $response = [];
function _before() {
$this->mapper = new SendGridMapper();
$this->response = [
'errors' => [
'Some message',
]
];
}
function testGetProperError() {
$error = $this->mapper->getErrorFromResponse($this->response, 'john@rambo.com');
expect($error->getLevel())->equals(MailerError::LEVEL_HARD);
expect($error->getMessage())->equals('Some message');
expect($error->getSubscriberErrors()[0]->getEmail())->equals('john@rambo.com');
}
function testGetSoftErrorForInvalidEmail() {
$this->response['errors'][0] = 'Invalid email address ,,@';
$error = $this->mapper->getErrorFromResponse($this->response, ',,@');
expect($error->getLevel())->equals(MailerError::LEVEL_SOFT);
}
}