diff --git a/tests/integration/Cron/Workers/SendingQueue/SendingErrorHandlerTest.php b/tests/integration/Cron/Workers/SendingQueue/SendingErrorHandlerTest.php index 928fa3cf8b..f6b56d7bbb 100644 --- a/tests/integration/Cron/Workers/SendingQueue/SendingErrorHandlerTest.php +++ b/tests/integration/Cron/Workers/SendingQueue/SendingErrorHandlerTest.php @@ -16,7 +16,7 @@ class SendingErrorHandlerTest extends \MailPoetTest { public function _before() { parent::_before(); - $this->errorHandler = new SendingErrorHandler(); + $this->errorHandler = $this->diContainer->get(SendingErrorHandler::class); } public function testItShouldProcessSoftErrorCorrectly() { diff --git a/tests/integration/Cron/Workers/SendingQueue/SendingQueueTest.php b/tests/integration/Cron/Workers/SendingQueue/SendingQueueTest.php index 69a6417fa9..f33012b1f0 100644 --- a/tests/integration/Cron/Workers/SendingQueue/SendingQueueTest.php +++ b/tests/integration/Cron/Workers/SendingQueue/SendingQueueTest.php @@ -61,6 +61,8 @@ class SendingQueueTest extends \MailPoetTest { public $segment; public $subscriber; private $mailerTaskDummyResponse = ['response' => true]; + /** @var SendingThrottlingHandler */ + private $sendingThrottlingHandler; /** @var SendingErrorHandler */ private $sendingErrorHandler; /** @var SettingsController */ @@ -122,7 +124,8 @@ class SendingQueueTest extends \MailPoetTest { $this->newsletterLink->hash = 'abcde'; $this->newsletterLink->save(); $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->loggerFactory = LoggerFactory::getInstance(); $this->cronHelper = $this->diContainer->get(CronHelper::class); @@ -168,6 +171,7 @@ class SendingQueueTest extends \MailPoetTest { ], $this); $sendingQueueWorker->__construct( $this->sendingErrorHandler, + $this->sendingThrottlingHandler, $this->statsNotificationsWorker, $this->loggerFactory, Stub::makeEmpty(NewslettersRepository::class), @@ -192,6 +196,7 @@ class SendingQueueTest extends \MailPoetTest { ], $this); $sendingQueueWorker->__construct( $this->sendingErrorHandler, + $this->sendingThrottlingHandler, $this->statsNotificationsWorker, $this->loggerFactory, Stub::makeEmpty(NewslettersRepository::class), @@ -233,6 +238,7 @@ class SendingQueueTest extends \MailPoetTest { ], $this); $sendingQueueWorker->__construct( $this->sendingErrorHandler, + $this->sendingThrottlingHandler, $this->statsNotificationsWorker, $this->loggerFactory, Stub::makeEmpty(NewslettersRepository::class), @@ -273,6 +279,7 @@ class SendingQueueTest extends \MailPoetTest { ], $this); $sendingQueueWorker->__construct( $this->sendingErrorHandler, + $this->sendingThrottlingHandler, $this->statsNotificationsWorker, $this->loggerFactory, Stub::makeEmpty(NewslettersRepository::class), @@ -788,6 +795,7 @@ class SendingQueueTest extends \MailPoetTest { ); $sendingQueueWorker->__construct( $this->sendingErrorHandler, + $this->sendingThrottlingHandler, $this->statsNotificationsWorker, $this->loggerFactory, Stub::makeEmpty(NewslettersRepository::class), @@ -1002,6 +1010,7 @@ class SendingQueueTest extends \MailPoetTest { private function getSendingQueueWorker($newsletterRepositoryMock = null, $mailerMock = null) { return new SendingQueueWorker( $this->sendingErrorHandler, + $this->sendingThrottlingHandler, $this->statsNotificationsWorker, $this->loggerFactory, $newsletterRepositoryMock ?: $this->newslettersRepository,