Update dependencies in tests

[MAILPOET-4047]
This commit is contained in:
Jan Lysý
2022-02-24 20:02:18 +01:00
committed by Veljko V
parent 581d5d1f7f
commit eced7d27cd
2 changed files with 19 additions and 9 deletions

View File

@@ -44,7 +44,7 @@ class MailPoetAPITest extends \MailPoetTest {
$this->settings['api_key'],
$this->sender,
$this->replyTo,
new MailPoetMapper(),
$this->diContainer->get(MailPoetMapper::class),
$this->makeEmpty(AuthorizedEmailsController::class)
);
$this->subscriber = 'Recipient <blackhole@mailpoet.com>';
@@ -85,7 +85,7 @@ class MailPoetAPITest extends \MailPoetTest {
$this->settings['api_key'],
$this->sender,
$replyTo,
new MailPoetMapper(),
$this->diContainer->get(MailPoetMapper::class),
$this->makeEmpty(AuthorizedEmailsController::class)
);
$body = $mailer->getBody($this->newsletter, $this->subscriber);
@@ -274,7 +274,7 @@ class MailPoetAPITest extends \MailPoetTest {
$this->settings['api_key'],
$this->sender,
$this->replyTo,
new MailPoetMapper(),
$this->diContainer->get(MailPoetMapper::class),
$this->makeEmpty(AuthorizedEmailsController::class, ['checkAuthorizedEmailAddresses' => Expected::once()])
);
$mailer->api = $this->makeEmpty(
@@ -295,7 +295,7 @@ class MailPoetAPITest extends \MailPoetTest {
$this->mailer,
[
'blacklist' => $blacklist,
'errorMapper' => new MailPoetMapper(),
'errorMapper' => $this->diContainer->get(MailPoetMapper::class),
'servicesChecker' => Stub::make(
new ServicesChecker(),
['isMailPoetAPIKeyValid' => true],
@@ -321,7 +321,7 @@ class MailPoetAPITest extends \MailPoetTest {
$this->mailer,
[
'blacklist' => $blacklist,
'errorMapper' => new MailPoetMapper(),
'errorMapper' => $this->diContainer->get(MailPoetMapper::class),
'servicesChecker' => Stub::make(
new ServicesChecker(),
['isMailPoetAPIKeyValid' => true],

View File

@@ -3,9 +3,13 @@
namespace MailPoet\Test\Mailer\Methods\ErrorMappers;
use Codeception\Stub;
use MailPoet\Config\ServicesChecker;
use MailPoet\Mailer\MailerError;
use MailPoet\Mailer\Methods\ErrorMappers\MailPoetMapper;
use MailPoet\Services\Bridge;
use MailPoet\Services\Bridge\API;
use MailPoet\Settings\SettingsController;
use MailPoet\Util\License\Features\Subscribers;
use MailPoet\WP\Functions as WPFunctions;
class MailPoetMapperTest extends \MailPoetUnitTest {
@@ -17,16 +21,22 @@ class MailPoetMapperTest extends \MailPoetUnitTest {
public function _before() {
parent::_before();
$this->mapper = new MailPoetMapper();
$this->subscribers = ['a@example.com', 'c d <b@example.com>'];
WPFunctions::set(Stub::make(new WPFunctions, [
$wpFunctions = Stub::make(new WPFunctions, [
'_x' => function ($value) {
return $value;
},
'escAttr' => function ($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() {