public function testJobId() { $job = new Job(); $this->assertNull($job->getId()); $job->setData(['foo' => 23, 'bar' => 42]); $this->assertNull($job->getId()); $job->setId(1337); $this->assertSame(1337, $job->getId()); }
/** * @param integer $length * @param integer $jobId * @return \Blar\Beanstalk\Job */ protected function readJob($length, $jobId) { $job = new Job(); $job->setBeanstalk($this); $job->setId($jobId); $job->setData(json_decode($this->readData($length))); return $job; }