Пример #1
0
 private function populateThrottleCounts()
 {
     foreach ($this->converted as $seconds => $convertedOption) {
         $max = $this->converted[$seconds][static::MAX];
         $count = $this->queueItemRepository->getUnsentQueueSize($convertedOption[static::DATETIME]);
         $diff = max(0, $max - $count);
         $this->converted[$seconds][static::COUNT] = $count;
         $this->converted[$seconds][static::DIFF] = $diff;
         $this->throttleCounts[$seconds] = $diff;
     }
 }
Пример #2
0
 /**
  * @covers DmMailer\Repository\QueueItem
  */
 public function testGetUnsentQueueSize()
 {
     $queueItems = $this->sut->getUnsentQueueSize(new \DateTime('2000-01-01'));
     $this->assertEquals(6, $queueItems);
 }