Refactor updateProcessedSubscribers() to use Doctrine instead of Paris

It was necessary to update a test to be more lenient when comparing
dates and another one to persist a change in Paris to the database.

[MAILPOET-4368]
This commit is contained in:
Rodrigo Primo
2023-07-07 09:37:17 -03:00
committed by Aschepikov
parent c0a091de04
commit 2b368141db
3 changed files with 6 additions and 16 deletions

View File

@@ -271,6 +271,7 @@ class SendingQueueTest extends \MailPoetTest {
// in the process() method and after that execution limits will be enforced
$queue = $this->queue;
$queue->status = SendingQueue::STATUS_COMPLETED;
$queue->save();
$sendingQueueWorker = $this->make(
$this->getSendingQueueWorker(),
[
@@ -616,7 +617,7 @@ class SendingQueueTest extends \MailPoetTest {
$updatedNewsletter = $this->newslettersRepository->findOneById($this->newsletter->id);
$this->assertInstanceOf(NewsletterEntity::class, $updatedNewsletter);
verify($updatedNewsletter->getStatus())->equals(Newsletter::STATUS_SENT);
verify($updatedNewsletter->getSentAt())->equals($scheduledTask->getProcessedAt());
verify($updatedNewsletter->getSentAt())->equalsWithDelta($scheduledTask->getProcessedAt(), 1);
// queue subscriber processed/to process count is updated
verify($scheduledTask->getSubscribersByProcessed(ScheduledTaskSubscriber::STATUS_UNPROCESSED))