mirror of
https://github.com/idanoo/php-resque
synced 2025-07-01 13:42:22 +00:00
Change arguments for jobs to an array instead of an object. Also change other json encoded items to decode to an array rather than objects
This commit is contained in:
parent
7ef1ebbd97
commit
c5396f4e86
10 changed files with 81 additions and 78 deletions
|
@ -153,7 +153,7 @@ class Resque_Tests_WorkerTest extends Resque_Tests_TestCase
|
|||
$job = $worker->reserve();
|
||||
$worker->workingOn($job);
|
||||
$worker->doneWorking();
|
||||
$this->assertEquals(new stdClass, $worker->job());
|
||||
$this->assertEquals(array(), $worker->job());
|
||||
}
|
||||
|
||||
public function testWorkerRecordsWhatItIsWorkingOn()
|
||||
|
@ -161,17 +161,18 @@ class Resque_Tests_WorkerTest extends Resque_Tests_TestCase
|
|||
$worker = new Resque_Worker('jobs');
|
||||
$worker->registerWorker();
|
||||
|
||||
$payload = new stdClass;
|
||||
$payload->class = 'Test_Job';
|
||||
$payload = array(
|
||||
'class' => 'Test_Job'
|
||||
);
|
||||
$job = new Resque_Job('jobs', $payload);
|
||||
$worker->workingOn($job);
|
||||
|
||||
$job = $worker->job();
|
||||
$this->assertEquals('jobs', $job->queue);
|
||||
if(!isset($job->run_at)) {
|
||||
$this->assertEquals('jobs', $job['queue']);
|
||||
if(!isset($job['run_at'])) {
|
||||
$this->fail('Job does not have run_at time');
|
||||
}
|
||||
$this->assertEquals($payload, $job->payload);
|
||||
$this->assertEquals($payload, $job['payload']);
|
||||
}
|
||||
|
||||
public function testWorkerErasesItsStatsWhenShutdown()
|
||||
|
@ -239,8 +240,9 @@ class Resque_Tests_WorkerTest extends Resque_Tests_TestCase
|
|||
$worker = new Resque_Worker('jobs');
|
||||
$worker->registerWorker();
|
||||
|
||||
$payload = new stdClass;
|
||||
$payload->class = 'Test_Job';
|
||||
$payload = array(
|
||||
'class' => 'Test_Job'
|
||||
);
|
||||
$job = new Resque_Job('jobs', $payload);
|
||||
|
||||
$worker->workingOn($job);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue