public function testSetLastRun() { $job = new TestJob(); $this->instance->add($job); $jobs = $this->getAllSorted(); $addedJob = $jobs[count($jobs) - 1]; $timeStart = time(); $this->instance->setLastRun($addedJob); $timeEnd = time(); $addedJob = $this->instance->getById($addedJob->getId()); $this->assertGreaterThanOrEqual($timeStart, $addedJob->getLastRun()); $this->assertLessThanOrEqual($timeEnd, $addedJob->getLastRun()); }
/** * @deprecated * deletes a queued task * @param int $id id of task * @return bool * * Deletes a report */ public static function deleteQueuedTask($id) { $jobList = new JobList(); $job = $jobList->getById($id); if ($job) { $jobList->remove($job); } }