79398624

Date: 2025-01-30 02:11:53
Score: 1.5
Natty:
Report link

This can be tested by using the ->withFakeQueueInteractions() method when instantiating the job.

use App\Exceptions\CorruptedAudioException;
use App\Jobs\ProcessPodcast;
 
$job = (new ProcessPodcast)->withFakeQueueInteractions();
 
$job->handle();
 
$job->assertReleased(delay: 30);
$job->assertDeleted();
$job->assertNotDeleted();
$job->assertFailed();
$job->assertFailedWith(CorruptedAudioException::class);
$job->assertNotFailed();

See more: https://laravel.com/docs/11.x/queues#testing-job-queue-interactions

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Fabián Álvarez