| @@ 49-60 (lines=12) @@ | ||
| 46 | self::assertGreaterThan(0, $limit); |
|
| 47 | } |
|
| 48 | ||
| 49 | public function testSaveJob() |
|
| 50 | { |
|
| 51 | $job = $this->getJob(); |
|
| 52 | $jobInQueue = self::$jobManager->getJob(); |
|
| 53 | self::assertNotNull($jobInQueue, 'There should be a job.'); |
|
| 54 | self::assertEquals( |
|
| 55 | $job->getId(), |
|
| 56 | $jobInQueue->getId(), |
|
| 57 | 'Job id returned by manager should be the same' |
|
| 58 | ); |
|
| 59 | self::$jobManager->deleteJob($job); |
|
| 60 | } |
|
| 61 | ||
| 62 | protected function getJob() |
|
| 63 | { |
|
| @@ 82-93 (lines=12) @@ | ||
| 79 | ); |
|
| 80 | } |
|
| 81 | ||
| 82 | public function testDeleteJob() |
|
| 83 | { |
|
| 84 | $this->drain(); |
|
| 85 | ||
| 86 | $job = $this->getJob(); |
|
| 87 | self::$jobManager->deleteJob($job); |
|
| 88 | ||
| 89 | $nextJob = self::$jobManager->getJob(); |
|
| 90 | self::assertNull($nextJob, "Shouldn't be any jobs left in queue"); |
|
| 91 | ||
| 92 | return $job; |
|
| 93 | } |
|
| 94 | ||
| 95 | /** |
|
| 96 | * Not all managers will support job priority. |
|