Fix dependecies in tests
[MAILPOET-3588]
This commit is contained in:
@ -16,7 +16,7 @@ class SendingErrorHandlerTest extends \MailPoetTest {
|
|||||||
|
|
||||||
public function _before() {
|
public function _before() {
|
||||||
parent::_before();
|
parent::_before();
|
||||||
$this->errorHandler = new SendingErrorHandler();
|
$this->errorHandler = $this->diContainer->get(SendingErrorHandler::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testItShouldProcessSoftErrorCorrectly() {
|
public function testItShouldProcessSoftErrorCorrectly() {
|
||||||
|
@ -61,6 +61,8 @@ class SendingQueueTest extends \MailPoetTest {
|
|||||||
public $segment;
|
public $segment;
|
||||||
public $subscriber;
|
public $subscriber;
|
||||||
private $mailerTaskDummyResponse = ['response' => true];
|
private $mailerTaskDummyResponse = ['response' => true];
|
||||||
|
/** @var SendingThrottlingHandler */
|
||||||
|
private $sendingThrottlingHandler;
|
||||||
/** @var SendingErrorHandler */
|
/** @var SendingErrorHandler */
|
||||||
private $sendingErrorHandler;
|
private $sendingErrorHandler;
|
||||||
/** @var SettingsController */
|
/** @var SettingsController */
|
||||||
@ -122,7 +124,8 @@ class SendingQueueTest extends \MailPoetTest {
|
|||||||
$this->newsletterLink->hash = 'abcde';
|
$this->newsletterLink->hash = 'abcde';
|
||||||
$this->newsletterLink->save();
|
$this->newsletterLink->save();
|
||||||
$this->subscribersFinder = $this->diContainer->get(SubscribersFinder::class);
|
$this->subscribersFinder = $this->diContainer->get(SubscribersFinder::class);
|
||||||
$this->sendingErrorHandler = new SendingErrorHandler();
|
$this->sendingErrorHandler = $this->diContainer->get(SendingErrorHandler::class);
|
||||||
|
$this->sendingThrottlingHandler = $this->diContainer->get(SendingThrottlingHandler::class);
|
||||||
$this->statsNotificationsWorker = Stub::makeEmpty(StatsNotificationsScheduler::class);
|
$this->statsNotificationsWorker = Stub::makeEmpty(StatsNotificationsScheduler::class);
|
||||||
$this->loggerFactory = LoggerFactory::getInstance();
|
$this->loggerFactory = LoggerFactory::getInstance();
|
||||||
$this->cronHelper = $this->diContainer->get(CronHelper::class);
|
$this->cronHelper = $this->diContainer->get(CronHelper::class);
|
||||||
@ -168,6 +171,7 @@ class SendingQueueTest extends \MailPoetTest {
|
|||||||
], $this);
|
], $this);
|
||||||
$sendingQueueWorker->__construct(
|
$sendingQueueWorker->__construct(
|
||||||
$this->sendingErrorHandler,
|
$this->sendingErrorHandler,
|
||||||
|
$this->sendingThrottlingHandler,
|
||||||
$this->statsNotificationsWorker,
|
$this->statsNotificationsWorker,
|
||||||
$this->loggerFactory,
|
$this->loggerFactory,
|
||||||
Stub::makeEmpty(NewslettersRepository::class),
|
Stub::makeEmpty(NewslettersRepository::class),
|
||||||
@ -192,6 +196,7 @@ class SendingQueueTest extends \MailPoetTest {
|
|||||||
], $this);
|
], $this);
|
||||||
$sendingQueueWorker->__construct(
|
$sendingQueueWorker->__construct(
|
||||||
$this->sendingErrorHandler,
|
$this->sendingErrorHandler,
|
||||||
|
$this->sendingThrottlingHandler,
|
||||||
$this->statsNotificationsWorker,
|
$this->statsNotificationsWorker,
|
||||||
$this->loggerFactory,
|
$this->loggerFactory,
|
||||||
Stub::makeEmpty(NewslettersRepository::class),
|
Stub::makeEmpty(NewslettersRepository::class),
|
||||||
@ -233,6 +238,7 @@ class SendingQueueTest extends \MailPoetTest {
|
|||||||
], $this);
|
], $this);
|
||||||
$sendingQueueWorker->__construct(
|
$sendingQueueWorker->__construct(
|
||||||
$this->sendingErrorHandler,
|
$this->sendingErrorHandler,
|
||||||
|
$this->sendingThrottlingHandler,
|
||||||
$this->statsNotificationsWorker,
|
$this->statsNotificationsWorker,
|
||||||
$this->loggerFactory,
|
$this->loggerFactory,
|
||||||
Stub::makeEmpty(NewslettersRepository::class),
|
Stub::makeEmpty(NewslettersRepository::class),
|
||||||
@ -273,6 +279,7 @@ class SendingQueueTest extends \MailPoetTest {
|
|||||||
], $this);
|
], $this);
|
||||||
$sendingQueueWorker->__construct(
|
$sendingQueueWorker->__construct(
|
||||||
$this->sendingErrorHandler,
|
$this->sendingErrorHandler,
|
||||||
|
$this->sendingThrottlingHandler,
|
||||||
$this->statsNotificationsWorker,
|
$this->statsNotificationsWorker,
|
||||||
$this->loggerFactory,
|
$this->loggerFactory,
|
||||||
Stub::makeEmpty(NewslettersRepository::class),
|
Stub::makeEmpty(NewslettersRepository::class),
|
||||||
@ -788,6 +795,7 @@ class SendingQueueTest extends \MailPoetTest {
|
|||||||
);
|
);
|
||||||
$sendingQueueWorker->__construct(
|
$sendingQueueWorker->__construct(
|
||||||
$this->sendingErrorHandler,
|
$this->sendingErrorHandler,
|
||||||
|
$this->sendingThrottlingHandler,
|
||||||
$this->statsNotificationsWorker,
|
$this->statsNotificationsWorker,
|
||||||
$this->loggerFactory,
|
$this->loggerFactory,
|
||||||
Stub::makeEmpty(NewslettersRepository::class),
|
Stub::makeEmpty(NewslettersRepository::class),
|
||||||
@ -1002,6 +1010,7 @@ class SendingQueueTest extends \MailPoetTest {
|
|||||||
private function getSendingQueueWorker($newsletterRepositoryMock = null, $mailerMock = null) {
|
private function getSendingQueueWorker($newsletterRepositoryMock = null, $mailerMock = null) {
|
||||||
return new SendingQueueWorker(
|
return new SendingQueueWorker(
|
||||||
$this->sendingErrorHandler,
|
$this->sendingErrorHandler,
|
||||||
|
$this->sendingThrottlingHandler,
|
||||||
$this->statsNotificationsWorker,
|
$this->statsNotificationsWorker,
|
||||||
$this->loggerFactory,
|
$this->loggerFactory,
|
||||||
$newsletterRepositoryMock ?: $this->newslettersRepository,
|
$newsletterRepositoryMock ?: $this->newslettersRepository,
|
||||||
|
Reference in New Issue
Block a user