Beispiel #1
0
 public function testShouldNotTwice()
 {
     $this->job->setLastRun(time() - 15);
     $this->job->execute($this->jobList);
     $this->assertTrue($this->jobRun);
     $this->jobRun = false;
     $this->job->execute($this->jobList);
     $this->assertFalse($this->jobRun);
 }
 /**
  * run the job, then remove it from the job list
  *
  * @param JobList $jobList
  * @param ILogger $logger
  */
 public function execute($jobList, ILogger $logger = null)
 {
     // add an interval of 15 mins
     $this->setInterval(15 * 60);
     $this->jobList = $jobList;
     $this->logger = $logger;
     parent::execute($jobList, $logger);
 }
 public function testJobShouldBeRemoved()
 {
     $this->assertTrue($this->jobList->has($this->job, null));
     $this->job->execute($this->jobList);
     $this->assertTrue($this->jobRun);
 }