コード例 #1
0
 /**
  * @dataProvider getNonTerminatedStatus
  */
 public function testUpdateJobWithNonTerminatedStatusValues($status)
 {
     $schedule = new Schedule();
     $schedule->setIsActive(true);
     $job = new Job();
     $job->addSchedule($schedule);
     $this->subject->updateJob($job, $status);
     $this->assertEquals($status, $job->getStatus());
     $this->assertNull($job->getTerminatedAt());
     $this->assertTrue($schedule->getIsActive());
 }
コード例 #2
0
 public function testOnSchedule()
 {
     $job = new Job();
     $job->setType('type');
     $job->setTicket('ticket');
     $schedule = new Schedule();
     $schedule->setJob($job);
     $event = new SchedulerEvent($schedule);
     $self = $this;
     $this->producer->expects($this->once())->method('produce')->willReturnCallback(function (Message $message) use($self) {
         $this->assertEquals('ticket', $message->getTicket());
         $this->assertEquals('type', $message->getType());
     });
     $this->subject->onSchedule($event);
 }
コード例 #3
0
ファイル: Schedule.php プロジェクト: aboutcoders/job-bundle
 /**
  * Override clone in order to avoid duplicating entries in Doctrine
  */
 public function __clone()
 {
     parent::__clone();
     $this->id = null;
 }