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('Worker in Ploi 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(); });