Refactor sending methods to use error mappers
We want to add some logic to error handling. This commit extracts error handling code from sending methods classes, which already do a lot of other stuff, to error mappers which are responsible for creating proper error object (MailerError). This error object is a replacement for assoc. array which already had some special keys for certain usecases and can not be properly type hinted. [MAILPOET-1154]
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
namespace MailPoet\Test\Mailer\Methods;
|
||||
|
||||
use MailPoet\Mailer\Methods\ErrorMappers\SendGridMapper;
|
||||
use MailPoet\Mailer\Methods\SendGrid;
|
||||
|
||||
class SendGridTest extends \MailPoetTest {
|
||||
@@ -24,7 +25,8 @@ class SendGridTest extends \MailPoetTest {
|
||||
$this->mailer = new SendGrid(
|
||||
$this->settings['api_key'],
|
||||
$this->sender,
|
||||
$this->reply_to
|
||||
$this->reply_to,
|
||||
new SendGridMapper()
|
||||
);
|
||||
$this->subscriber = 'Recipient <mailpoet-phoenix-test@mailinator.com>';
|
||||
$this->newsletter = array(
|
||||
|
Reference in New Issue
Block a user