| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- namespace Tests\Unit\Jobs;
- use App\Jobs\ExportReclamationsJob;
- use Illuminate\Support\Facades\Bus;
- use Illuminate\Support\Facades\Queue;
- use Tests\TestCase;
- class ExportReclamationsJobTest extends TestCase
- {
- public function test_job_can_be_dispatched(): void
- {
- Bus::fake();
- ExportReclamationsJob::dispatch([1, 2, 3], 1);
- Bus::assertDispatched(ExportReclamationsJob::class);
- }
- public function test_job_is_queued_via_queue_fake(): void
- {
- Queue::fake();
- ExportReclamationsJob::dispatch([1, 2, 3], 1);
- Queue::assertPushed(ExportReclamationsJob::class);
- }
- public function test_job_dispatched_with_empty_ids(): void
- {
- Bus::fake();
- ExportReclamationsJob::dispatch([], 1);
- Bus::assertDispatched(ExportReclamationsJob::class);
- }
- public function test_job_not_dispatched_without_dispatch_call(): void
- {
- Bus::fake();
- Bus::assertNotDispatched(ExportReclamationsJob::class);
- }
- }
|