| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- namespace Tests\Unit\Jobs;
- use App\Jobs\ExportMafJob;
- use Illuminate\Support\Facades\Bus;
- use Illuminate\Support\Facades\Queue;
- use Tests\TestCase;
- class ExportMafJobTest extends TestCase
- {
- public function test_job_can_be_dispatched(): void
- {
- Bus::fake();
- ExportMafJob::dispatch(1, ['year' => 2026]);
- Bus::assertDispatched(ExportMafJob::class);
- }
- public function test_job_is_queued_via_queue_fake(): void
- {
- Queue::fake();
- ExportMafJob::dispatch(1, ['year' => 2026]);
- Queue::assertPushed(ExportMafJob::class);
- }
- public function test_job_dispatched_without_year_filter(): void
- {
- Bus::fake();
- ExportMafJob::dispatch(1, []);
- Bus::assertDispatched(ExportMafJob::class);
- }
- public function test_job_not_dispatched_without_dispatch_call(): void
- {
- Bus::fake();
- Bus::assertNotDispatched(ExportMafJob::class);
- }
- }
|