/** * @return array */ protected function getStats() { if (!$this->stats) { $this->stats = $this->beanstalk->stats(); } return $this->stats; }
public function testMarkAsErrorBuriesBeanstalkJob() { $jobId = 123; $job = $this->getMock('\\Phlib\\JobQueue\\JobInterface'); $job->expects($this->any())->method('getId')->will($this->returnValue($jobId)); $this->beanstalk->expects($this->once())->method('bury')->with($this->equalTo($jobId)); $this->jobQueue->markAsError($job); }
/** * @param ConnectionInterface $connection * @param integer $id * @return string */ public function combineId(ConnectionInterface $connection, $id) { if (!is_numeric($id)) { throw new InvalidArgumentException('Specified job id must be a number.'); } return "{$connection->getName()}.{$id}"; }
/** * @inheritdoc */ public function markAsError(JobInterface $job) { return $this->beanstalk->bury($job->getId()); }