コード例 #1
0
 public function testIncrementSentCount()
 {
     $notification = new Notification();
     $this->assertEquals(0, $notification->getSentCount());
     $notification->incrementSentCount();
     $this->assertEquals(1, $notification->getSentCount());
 }
コード例 #2
0
 private function scheduleNotification(Notification $notification)
 {
     $notification->incrementSentCount();
     $seconds = $this->scheduler->getDiffInSeconds($notification->getSentCount());
     $notification->setSentAt(new \DateTime())->setScheduledAt((new \DateTime())->modify("+{$seconds} seconds"));
     $this->storage->persist($notification);
 }