feat: add PollFuelPricesJob queued job

This commit is contained in:
Ovidiu U
2026-04-04 14:04:45 +01:00
parent cf187f9721
commit 99b0ce480b
2 changed files with 29 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
<?php
namespace App\Jobs;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Queue\Queueable;
use Illuminate\Support\Facades\Artisan;
class PollFuelPricesJob implements ShouldQueue
{
use Queueable;
public function handle(): void
{
Artisan::call('fuel:poll', ['--full' => true]);
}
}

View File

@@ -0,0 +1,12 @@
<?php
use App\Jobs\PollFuelPricesJob;
use Illuminate\Support\Facades\Queue;
it('dispatches to the default queue', function () {
Queue::fake();
PollFuelPricesJob::dispatch();
Queue::assertPushed(PollFuelPricesJob::class);
});