Skip to content

Commit

Permalink
Back to 7c8d3d0 + test (#22343)
Browse files Browse the repository at this point in the history
Put the payload column of jobs table to the end of insert statements.
  • Loading branch information
gabomasi authored and taylorotwell committed Dec 7, 2017
1 parent 1bc8dd9 commit 1fa9dac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Queue/DatabaseQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@ protected function buildDatabaseRecord($queue, $payload, $availableAt, $attempts
{
return [
'queue' => $queue,
'payload' => $payload,
'attempts' => $attempts,
'reserved_at' => null,
'available_at' => $availableAt,
'created_at' => $this->currentTime(),
'payload' => $payload,
];
}

Expand Down
8 changes: 8 additions & 0 deletions tests/Queue/QueueDatabaseQueueUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,12 @@ public function testBulkBatchPushesOntoDatabase()

$queue->bulk(['foo', 'bar'], ['data'], 'queue');
}

public function testBuildDatabaseRecordWithPayloadAtTheEnd()
{
$queue = m::mock('Illuminate\Queue\DatabaseQueue');
$record = $queue->buildDatabaseRecord('queue','any_payload',0);
$this->assertArrayHasKey('payload', $record);
$this->assertArrayHasKey('payload', array_slice($record, -1, 1, TRUE));
}
}

0 comments on commit 1fa9dac

Please sign in to comment.