예제 #1
0
 /**
  * Run schedules
  *
  * @return void
  */
 public function runSchedules()
 {
     $this->model->updateAllTypeStatus();
     $schedules = $this->model->getExpiredAndEnabledSchedules();
     foreach ($schedules as $schedule) {
         $event = new CronEvent($this->model);
         $event->setSchedule($schedule);
         $this->dispatcher->dispatch('cron_event.' . $schedule->getEvent(), $event);
     }
 }
예제 #2
0
 /**
  * Test update timers and events statuses
  */
 public function testUpdateAllTypeStatus()
 {
     $repository = $this->getMockObject('Litvinab\\Bundle\\CronEventBundle\\Repository\\ScheduleRepository', ['updateTimersStatus', 'updateEventsStatus']);
     $model = new ScheduleModel($repository);
     $model->updateAllTypeStatus();
     $this->assertTrue(true);
 }