Remove remaining uses of the ScheduledTaskSubscriber model from Sending

[MAILPOET-4368]
This commit is contained in:
Rodrigo Primo
2023-07-07 11:48:32 -03:00
committed by Aschepikov
parent 63a0f0b940
commit 18d34202a8
3 changed files with 31 additions and 4 deletions

View File

@@ -96,4 +96,24 @@ class ScheduledTaskSubscribersRepositoryTest extends \MailPoetTest {
$this->assertSame([$this->taskSubscriber2, $this->taskSubscriber3], $this->repository->findBy(['task' => $this->scheduledTask1]));
$this->assertSame([], $this->repository->findBy(['task' => $this->scheduledTask2]));
}
public function testCountProcessed() {
$this->assertSame(2, $this->repository->countProcessed($this->scheduledTask1));
$this->assertSame(1, $this->repository->countProcessed($this->scheduledTask2));
$subscriberId = $this->subscriberUnprocessed->getId();
$this->assertIsInt($subscriberId);
$this->repository->updateProcessedSubscribers($this->scheduledTask2, [$subscriberId]);
$this->assertSame(2, $this->repository->countProcessed($this->scheduledTask2));
}
public function testCountUnprocessed() {
$this->assertSame(1, $this->repository->countUnprocessed($this->scheduledTask1));
$this->assertSame(1, $this->repository->countUnprocessed($this->scheduledTask2));
$subscriberId = $this->subscriberUnprocessed->getId();
$this->assertIsInt($subscriberId);
$this->repository->updateProcessedSubscribers($this->scheduledTask2, [$subscriberId]);
$this->assertSame(0, $this->repository->countUnprocessed($this->scheduledTask2));
}
}