ExportReclamationsJobTest.php 1020 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace Tests\Unit\Jobs;
  3. use App\Jobs\ExportReclamationsJob;
  4. use Illuminate\Support\Facades\Bus;
  5. use Illuminate\Support\Facades\Queue;
  6. use Tests\TestCase;
  7. class ExportReclamationsJobTest extends TestCase
  8. {
  9. public function test_job_can_be_dispatched(): void
  10. {
  11. Bus::fake();
  12. ExportReclamationsJob::dispatch([1, 2, 3], 1);
  13. Bus::assertDispatched(ExportReclamationsJob::class);
  14. }
  15. public function test_job_is_queued_via_queue_fake(): void
  16. {
  17. Queue::fake();
  18. ExportReclamationsJob::dispatch([1, 2, 3], 1);
  19. Queue::assertPushed(ExportReclamationsJob::class);
  20. }
  21. public function test_job_dispatched_with_empty_ids(): void
  22. {
  23. Bus::fake();
  24. ExportReclamationsJob::dispatch([], 1);
  25. Bus::assertDispatched(ExportReclamationsJob::class);
  26. }
  27. public function test_job_not_dispatched_without_dispatch_call(): void
  28. {
  29. Bus::fake();
  30. Bus::assertNotDispatched(ExportReclamationsJob::class);
  31. }
  32. }