Remove reading batch size from constructor

[MAILPOET-3588]
This commit is contained in:
Jan Lysý
2021-04-30 15:26:25 +02:00
committed by Veljko V
parent 3126998212
commit aba99b84f2
2 changed files with 10 additions and 5 deletions

View File

@@ -155,11 +155,14 @@ class SendingQueueTest extends \MailPoetTest {
}
public function testItConstructs() {
expect($this->sendingQueueWorker->batchSize)->equals(SendingThrottlingHandler::BATCH_SIZE);
expect($this->sendingQueueWorker->mailerTask instanceof MailerTask);
expect($this->sendingQueueWorker->newsletterTask instanceof NewsletterTask);
}
public function testItReturnsCorrectBatchSize(): void {
expect($this->sendingQueueWorker->getBatchSize())->equals(SendingThrottlingHandler::BATCH_SIZE);
}
public function testItEnforcesExecutionLimitsBeforeQueueProcessing() {
$sendingQueueWorker = Stub::make($this->getSendingQueueWorker(
Stub::makeEmpty(NewslettersRepository::class)),
@@ -861,7 +864,7 @@ class SendingQueueTest extends \MailPoetTest {
$wp = new WPFunctions;
$wp->addFilter('mailpoet_cron_worker_sending_queue_batch_size', $filter);
$sendingQueueWorker = $this->getSendingQueueWorker(Stub::makeEmpty(NewslettersRepository::class));
expect($sendingQueueWorker->batchSize)->equals($customBatchSizeValue);
expect($sendingQueueWorker->getBatchSize())->equals($customBatchSizeValue);
$wp->removeFilter('mailpoet_cron_worker_sending_queue_batch_size', $filter);
}