'sync', 'cache.default' => 'array']); }); test('a running worker picks up the probe job', function () { Sleep::fake(); $this->artisan('monitoring:queue-probe', ['--wait' => 30]) ->expectsOutputToContain('Queue-Worker läuft (Test-Job nach 0 s abgeholt).') ->assertSuccessful(); Sleep::assertSleptTimes(0); }); test('without a worker the probe fails after the waiting time with a hint', function () { Sleep::fake(); Queue::fake(); $this->artisan('monitoring:queue-probe', ['--wait' => 5]) ->expectsOutputToContain('Kein Queue-Worker hat den Test-Job innerhalb von 5 s abgeholt.') ->expectsOutputToContain('Horizon prüfen') ->assertFailed(); Queue::assertPushed(QueueProbe::class, fn (QueueProbe $job): bool => $job->queue === null); Sleep::assertSleptTimes(5); }); test('the probe job only acknowledges its own token', function () { (new QueueProbe('abc'))->handle(); expect(cache()->has(QueueProbe::cacheKey('abc')))->toBeTrue() ->and(cache()->has(QueueProbe::cacheKey('xyz')))->toBeFalse(); }); test('the version shows up in artisan about', function () { config(['app.version' => 'v9.9.9']); $this->artisan('about', ['--only' => 'mivita']) ->expectsOutputToContain('v9.9.9') ->assertSuccessful(); });