Update dependencies in tests
[MAILPOET-4047]
This commit is contained in:
@@ -44,7 +44,7 @@ class MailPoetAPITest extends \MailPoetTest {
|
|||||||
$this->settings['api_key'],
|
$this->settings['api_key'],
|
||||||
$this->sender,
|
$this->sender,
|
||||||
$this->replyTo,
|
$this->replyTo,
|
||||||
new MailPoetMapper(),
|
$this->diContainer->get(MailPoetMapper::class),
|
||||||
$this->makeEmpty(AuthorizedEmailsController::class)
|
$this->makeEmpty(AuthorizedEmailsController::class)
|
||||||
);
|
);
|
||||||
$this->subscriber = 'Recipient <blackhole@mailpoet.com>';
|
$this->subscriber = 'Recipient <blackhole@mailpoet.com>';
|
||||||
@@ -85,7 +85,7 @@ class MailPoetAPITest extends \MailPoetTest {
|
|||||||
$this->settings['api_key'],
|
$this->settings['api_key'],
|
||||||
$this->sender,
|
$this->sender,
|
||||||
$replyTo,
|
$replyTo,
|
||||||
new MailPoetMapper(),
|
$this->diContainer->get(MailPoetMapper::class),
|
||||||
$this->makeEmpty(AuthorizedEmailsController::class)
|
$this->makeEmpty(AuthorizedEmailsController::class)
|
||||||
);
|
);
|
||||||
$body = $mailer->getBody($this->newsletter, $this->subscriber);
|
$body = $mailer->getBody($this->newsletter, $this->subscriber);
|
||||||
@@ -274,7 +274,7 @@ class MailPoetAPITest extends \MailPoetTest {
|
|||||||
$this->settings['api_key'],
|
$this->settings['api_key'],
|
||||||
$this->sender,
|
$this->sender,
|
||||||
$this->replyTo,
|
$this->replyTo,
|
||||||
new MailPoetMapper(),
|
$this->diContainer->get(MailPoetMapper::class),
|
||||||
$this->makeEmpty(AuthorizedEmailsController::class, ['checkAuthorizedEmailAddresses' => Expected::once()])
|
$this->makeEmpty(AuthorizedEmailsController::class, ['checkAuthorizedEmailAddresses' => Expected::once()])
|
||||||
);
|
);
|
||||||
$mailer->api = $this->makeEmpty(
|
$mailer->api = $this->makeEmpty(
|
||||||
@@ -295,7 +295,7 @@ class MailPoetAPITest extends \MailPoetTest {
|
|||||||
$this->mailer,
|
$this->mailer,
|
||||||
[
|
[
|
||||||
'blacklist' => $blacklist,
|
'blacklist' => $blacklist,
|
||||||
'errorMapper' => new MailPoetMapper(),
|
'errorMapper' => $this->diContainer->get(MailPoetMapper::class),
|
||||||
'servicesChecker' => Stub::make(
|
'servicesChecker' => Stub::make(
|
||||||
new ServicesChecker(),
|
new ServicesChecker(),
|
||||||
['isMailPoetAPIKeyValid' => true],
|
['isMailPoetAPIKeyValid' => true],
|
||||||
@@ -321,7 +321,7 @@ class MailPoetAPITest extends \MailPoetTest {
|
|||||||
$this->mailer,
|
$this->mailer,
|
||||||
[
|
[
|
||||||
'blacklist' => $blacklist,
|
'blacklist' => $blacklist,
|
||||||
'errorMapper' => new MailPoetMapper(),
|
'errorMapper' => $this->diContainer->get(MailPoetMapper::class),
|
||||||
'servicesChecker' => Stub::make(
|
'servicesChecker' => Stub::make(
|
||||||
new ServicesChecker(),
|
new ServicesChecker(),
|
||||||
['isMailPoetAPIKeyValid' => true],
|
['isMailPoetAPIKeyValid' => true],
|
||||||
|
@@ -3,9 +3,13 @@
|
|||||||
namespace MailPoet\Test\Mailer\Methods\ErrorMappers;
|
namespace MailPoet\Test\Mailer\Methods\ErrorMappers;
|
||||||
|
|
||||||
use Codeception\Stub;
|
use Codeception\Stub;
|
||||||
|
use MailPoet\Config\ServicesChecker;
|
||||||
use MailPoet\Mailer\MailerError;
|
use MailPoet\Mailer\MailerError;
|
||||||
use MailPoet\Mailer\Methods\ErrorMappers\MailPoetMapper;
|
use MailPoet\Mailer\Methods\ErrorMappers\MailPoetMapper;
|
||||||
|
use MailPoet\Services\Bridge;
|
||||||
use MailPoet\Services\Bridge\API;
|
use MailPoet\Services\Bridge\API;
|
||||||
|
use MailPoet\Settings\SettingsController;
|
||||||
|
use MailPoet\Util\License\Features\Subscribers;
|
||||||
use MailPoet\WP\Functions as WPFunctions;
|
use MailPoet\WP\Functions as WPFunctions;
|
||||||
|
|
||||||
class MailPoetMapperTest extends \MailPoetUnitTest {
|
class MailPoetMapperTest extends \MailPoetUnitTest {
|
||||||
@@ -17,16 +21,22 @@ class MailPoetMapperTest extends \MailPoetUnitTest {
|
|||||||
|
|
||||||
public function _before() {
|
public function _before() {
|
||||||
parent::_before();
|
parent::_before();
|
||||||
$this->mapper = new MailPoetMapper();
|
$wpFunctions = Stub::make(new WPFunctions, [
|
||||||
$this->subscribers = ['a@example.com', 'c d <b@example.com>'];
|
|
||||||
WPFunctions::set(Stub::make(new WPFunctions, [
|
|
||||||
'_x' => function ($value) {
|
'_x' => function ($value) {
|
||||||
return $value;
|
return $value;
|
||||||
},
|
},
|
||||||
'escAttr' => function ($value) {
|
'escAttr' => function ($value) {
|
||||||
return $value;
|
return $value;
|
||||||
},
|
},
|
||||||
]));
|
]);
|
||||||
|
$this->mapper = new MailPoetMapper(
|
||||||
|
Stub::make(Bridge::class),
|
||||||
|
Stub::make(ServicesChecker::class),
|
||||||
|
Stub::make(SettingsController::class),
|
||||||
|
Stub::make(Subscribers::class),
|
||||||
|
$wpFunctions
|
||||||
|
);
|
||||||
|
$this->subscribers = ['a@example.com', 'c d <b@example.com>'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testCreateBlacklistError() {
|
public function testCreateBlacklistError() {
|
||||||
|
Reference in New Issue
Block a user