Unverified Commit f826130f authored by Jens Segers's avatar Jens Segers Committed by GitHub

Merge pull request #1852 from denissonleal/hotfix/find-null-failed-job

fix find null failed job
parents 0cc2e6c7 b040f142
......@@ -46,6 +46,10 @@ class MongoFailedJobProvider extends DatabaseFailedJobProvider
{
$job = $this->getTable()->find($id);
if (!$job) {
return;
}
$job['id'] = (string) $job['_id'];
return (object) $job;
......
......@@ -55,4 +55,12 @@ class QueueTest extends TestCase
$job->delete();
$this->assertEquals(0, Queue::getDatabase()->table(Config::get('queue.connections.database.table'))->count());
}
public function testFindFailJobNull(): void
{
Config::set('queue.failed.database', 'mongodb');
$provider = app('queue.failer');
$this->assertNull($provider->find(1));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment